-
-
Notifications
You must be signed in to change notification settings - Fork 985
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 "" #1031
Comments
laravel-dompdf/.github/ISSUE_TEMPLATE/bug_report.md Lines 10 to 12 in 424a223
|
I got this error too. and here is my code. ` // comment here to cache fonts file return $pdf->stream('example.pdf'); ` I have already put my fonts file .ttf to storage/fonts but Laravel doesn't cache it into .ufm file. So I uncomment ( sorry for my English.) |
In my case I installed a custom font using this util provided by Dompdf, I managed to resolve this by updating Open this file you should see something like: {
"myfont": {
"normal": "storage\/fonts\/myfont",
"bold": "storage\/fonts\/myfont",
"italic": "storage\/fonts\/myfont",
"bold_italic": "storage\/fonts\/myfont"
}
} For each of the font variant path remove the prefix |
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? Why are those arrays and variables empty? It seems like a problem with the package.
I am using laravel 10.10 and barryvdh/laravel-dompdf 2.0.1.
The text was updated successfully, but these errors were encountered: