Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 842
151291 Avatar asked Dec 07 '22 18:12

151291


1 Answers

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

like image 98
151291 Avatar answered Dec 10 '22 21:12

151291