ErrorException in Cpdf.php line 3855: Undefined index: at barryvdh/laravel-dompdf

扶醉桌前 提交于 2019-12-02 00:29:52

问题


I am using laravel 5.2, The dompdf runs fine at localhost but when moved to AWS it keeps showing ErrorException in Cpdf.php line 3855: Undefined index:, in this line (3855) has font variable.

Sample code :

$html = "<h2>Hello</h2>";
PDF::setOptions(['dpi' => 150, 'defaultFont' => 'sans-serif']);
$pdf = PDF::loadHTML($html)->setPaper('a4', 'landscape');
return $pdf->download('pdfview.pdf');

I can not set 'currentFont' => 'sans-serif' at setOptions due to no options in barryvdh/laravel-dompdf. so how can I solve currentFont issue.

Localhost - Windows - Runs fine.

AWS - Linux - Error.


回答1:


Error solved by delete dompdf_font_family_cache.php file from storage/fonts and let the renderer regenerate the cache.



来源:https://stackoverflow.com/questions/43732942/errorexception-in-cpdf-php-line-3855-undefined-index-at-barryvdh-laravel-dompd

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!