Reputation: 51
I have this code to try to generate a report as pdf:
$details=array(
'id'=>$find->id,
'full_letter_title'=>$find->full_letter_title,
'smarok_no'=>$find->smarok_no
);
$data['details']=$details;
$pdf = PDF::loadView('letter.view', $data);
return $pdf->stream();
But it return error
ErrorException in Adobe_Font_Metrics.php line 42: fopen(C:\xampp\htdocs\ams\storage\fonts/ba50cf37c0b6d75f8275d2b44106f606.ufm): failed to open stream: No such file or directory
I cant understand whats wrong here.
Upvotes: 1
Views: 3504
Reputation: 381
Try this:
$pdf = PDF::loadView('letter.view', $data)->setOptions(['defaultFont' => 'sans-serif']);
It worked for me, i didn't create any font folder/file
Upvotes: 0
Reputation: 2954
STEPS
NOW IT'S RUN
[reference] (https://github.com/barryvdh/laravel-dompdf/issues/269)
Upvotes: 1
Reputation: 16
This will be solved by creating Font Directory inside the Storage folder. This is used to store the temporary files . But anyhow Dompdf is not a effective library for PDF . I already used this and gotta more css issues about alignments . I would suggest you to use the Phanthomjs PDF . https://github.com/danielboendergaard/phantom-pdf It's much better than DomPDF .
Upvotes: 0