dimanche 14 juillet 2019

How to fix "The exit status code '-1073741819' " in Laravel using wkhtmltopdf to download pdf?

I'm trying to create an export button which converts an HTML page to PDF then downloads it.

I'm using Windows 10, XAMPP, Laravel 5.8, wkhtmltopdf.

Here is the error screenshot : enter image description here

Snappy Config:

'pdf' => [
    'enabled' => true,
    'binary'  => '"F:\wkhtmltopdf\bin\wkhtmltopdf.exe"',   
    'timeout' => false,
    'options' => [],
    'env'     => [],
],
'image' => [
    'enabled' => true,
    'binary'  => '"F:\wkhtmltopdf\bin\wkhtmltoimage.exe"',
    'timeout' => false,
    'options' => [],
    'env'     => [],
],

Export Code :

    $export_data = $this->exportData($checklist, $request);

    $pdf_content = view('checklist.pdf.content')->with($export_data);

    $pdf = PDF::loadHTML($pdf_content);
    $pdf->setPaper('letter');

    if ($checklist->weekly_monthly) {
        $pdf->setOrientation('landscape');
    }

    $pdf->setOption('header-spacing', 30);
    $pdf->setOption('header-html', view('checklist.pdf.header')->with($export_data));
    $pdf->setOption('footer-html', view('report.pdf.footer'));

    return $pdf->download($save_path);



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire