-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undefined array key "" #3384
Comments
Those should never be empty, what does your code look like on the PHP side of things? |
I have no idea why are those empty... A note - i am using https://github.com/barryvdh/laravel-dompdf but the error comes from dompdf/dompdf library. |
I'm not a laravel user, so you might ask on that project. Perhaps you need to update the fontDir configuration? |
I tried, but with no luck. |
What is layouts.pdf? Is that a PDF document or a Laravel blade template that just happens to have .pdf in its name? |
any updates on this, by any chance? just updated from dompdf 2.0.3 to dompdf 3, my script worked perfectly before the update and i now have the same problem, the line number has changed a bit compared to this post's first message but that's all:
these are the options i have:
i tried to add:
as well as this:
and then:
but it doesn't change anything. and yes, i adapted the /path/to/fonts in the code. any ideas? |
ok, i replaced all my options with this code found in the documentation:
still unsure why, but now it works! |
@legibe-com curious ... if you remove the "defaultFont" option does the error return? |
it doesn't! i can actually remove the
since my html template uses external css and font files, and it works. if i remove this option it works too, but without the right css formatting. i suppose that keeping the old code to set default variables etc was creating a conflict, somehow... |
When i try to output my pdf i get "Undefined array key ''" on line 4752 in dompdf\dompdf\lib\Cpdf.php. That particular line of code is:
$font = $this->fonts[$this->currentFont];
Both $this->fonts and $this->currentFont are empty. Why is this happening and how can i fix it?
The text was updated successfully, but these errors were encountered: