Closed vaibhavsingh31390 closed 4 months ago
$body = view('ENG.Reports.Bomrep.BomRepdtlallpdfBody', compact('fdatas', 'unit_detail', 'unit_code', 'unitname', 'pcode', 'userData'))->render();
$snappy = app('snappypdf'); // Use the 'snappypdf' service
$header = view('ENG.Reports.Header')->render();
$pdf = $snappy->loadHTML($body, [], [
'enable-local-file-access' => true,
'orientation' => 'portrait',
'encoding' => 'UTF-8',
'dpi' => 72,
]);
$pdf->setTimeout(100000000);
$pdf->setOption('margin-top', 12);
$pdf->setOption('header-html', $header);
$pdf->setOption('header-spacing', 2);
return $pdf->download('BOMdetail.pdf');
The code I am using to create the PDF, this works until 800 pages after that it gives the same error but only on centOS server environment.
The issue was my global header and the JS
`
I have been successfully using the Snappy library to generate PDFs on my Windows machine. However, when attempting to generate the same PDF on a CentOS-based server, I encountered an error. This issue seems to occur specifically when dealing with large datasets, resulting in PDFs exceeding 3000 pages.
Steps Taken:
Installed CentOS 7 specific version of Snappy. Attempted to utilize Snappy via Composer library directly. Error Encountered: Symfony\Component\Process\Exception\ProcessSignaledException The process has been signaled with signal "11".
do { $this->checkTimeout(); $running = $this->isRunning() && ('\' === \DIRECTORY_SEPARATOR || $this->processPipes->areOpen()); $this->readPipes($running, '\' !== \DIRECTORY_SEPARATOR || !$running); } while ($running); while ($this->isRunning()) { $this->checkTimeout(); usleep(1000); }
Additional Information:
The error occurs consistently when processing large datasets. The PDF generation process works without issue on a Windows environment. This issue impedes the functionality of the application on the CentOS server. I would appreciate any insights or suggestions on how to resolve this issue and successfully generate PDFs on the CentOS server using the Snappy library.![image](https://github.com/barryvdh/laravel-snappy/assets/79097275/b91c158e-dd62-4031-ae71-167e1c1e9177)