0
votes

I have to use the DomPDF package in the laravel(5.8) project. But we face a Maximum execution time Error in the report creation process.

I get a query result in 6sec. My query count is 1971.

My package details: barryvdh/laravel-dompdf: "0.8.7" laravel/framework": "5.8"

My sample code for report creation:

$pdf = PDF::loadView('reports.demodetails.viewreport',compact('alldetails'));

return $pdf->download('demoreport.pdf');

But the report creation process takes more time to load.

I really appreciate it if anyone can suggest it to me.

1

1 Answers

1
votes

I use the "barryvdh/laravel-snappy" package instead of "barryvdh/laravel-dompdf". I got the result in 16 secs.(My total records are 1971)

Note: Dompdf same records I got 1/2 hrs to generate PDF.

Anyone have this problem PL find the below steps to install the "barryvdh/laravel-snappy" package.

Step1: composer require barryvdh/laravel-snappy

a) Add provider Barryvdh\Snappy\ServiceProvider::class,

b)Add Aliases 'PDF' => Barryvdh\Snappy\Facades\SnappyPdf::class, 'SnappyImage' => Barryvdh\Snappy\Facades\SnappyImage::class,

c)Publish php artisan vendor:publish --provider="Barryvdh\Snappy\ServiceProvider"

Step2: composer require wemersonjanuario/wkhtmltopdf-windows

a)Set binary path in snappy file.

In live server(Linux) follow the below link and setup the wkhtmltopdf and wkhtmltoimage, After set the binary path values.

https://askubuntu.com/questions/959152/how-can-i-install-the-latest-wkhtmltopdf-on-ubuntu-16-04