0

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);
MUHAMMAD Siyab
  • 436
  • 1
  • 9
  • 20
  • in cases like this it would be awesome to share if you work locally or on a specific server. – Daniel Nov 21 '22 at 06:06
  • also just do what the error tells u and increase these in php.ini upload_max_filesize post_max_size memory_limit – Daniel Nov 21 '22 at 06:07
  • also i cant see the structure of your directory... cant tell if you target a img or the folder. – Daniel Nov 21 '22 at 06:08
  • @Daniel I am on the production server. Trying to create a PDF file from the blade view. The full_path variable contains the path like "public/vouchers/{dynamic-directory-name}/filename.pdf" . vouchers folder already exists there but the "{dynamic-directory-name}" folder would be created by laravel. – MUHAMMAD Siyab Nov 21 '22 at 10:35
  • @Daniel I increased the upload_max_filesize and post_max_size plus memory_limit but nothing worked. – MUHAMMAD Siyab Nov 21 '22 at 10:54

1 Answers1

0

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

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 16 '23 at 10:48