Reputation: 446
I am using laravel-dompdf to create a pdf file and save it to drive. Unfortunately, i am getting the above mentioned error. I tried different solutions including increasing the memory limit and max upload size but that didn't help. None of the existing answers on stackoverflow helped. Any help would be highly appreciated.
My Code:
$pdf = \Barryvdh\DomPDF\Facade\Pdf::loadView(
'fee_vouchers.saved_voucher',
$data
);
$output = $pdf->setPaper('a4', 'landscape')
->setWarnings(false)
->output();
Storage::put($full_path, $output);
Upvotes: 0
Views: 1554
Reputation: 296
it's a bit late but to answer your question: it has nothing to do with the upload size or memory!
The error comes from image(s) in your view 'fee_vouchers.saved_voucher' that laravel-dompdf fails to access.
So check the paths to the images in your view and, if they are generated dynamically, add an if statement to check if the image exists in the directory.
Upvotes: 0
Reputation: 1
i got same error ,now i fix it by following way
1)attech all file is exsit or not please check
2) image's src have file path not url, like "http://....jpg" is wong way
3) try to ignore ingration other's site css and js urlfor pdf layout
Upvotes: 0