Skip to content
Advertisement

Laravel: DOMPDF error when trying to get PDF

I’ve been trying to get the PDF of a view using DOMPDF with a table full of ingredients populated from a database table.

I created a function in my Controller:

JavaScript

And the route in web.php is defined as:

JavaScript

However, I keep getting this error:

fopen(D:mealplanstoragefonts//nunito_normal_46b9b3b48cc3ddbae60da82f1c1c5d29.ufm): failed to open stream: No such file or directory

It must be something to do with the ‘printableingredientslist‘ as when I replaced it with a plain view page with simple text that worked. I am struggling to see how there’s a path issue however, as printableingredientslist.blade.php is simply under the views folder. What can the issue be? I am using tailwind.css, could that be a problem?

Advertisement

Answer

setOptions method to use default font.For example like below

JavaScript

or

Create the directory fonts in storage directory

Ref: https://github.com/barryvdh/laravel-dompdf/issues/724

Ref:https://github.com/barryvdh/laravel-dompdf/issues/176

Ref:https://github.com/barryvdh/laravel-dompdf/issues/269

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement