Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel 5.6 using barryvdh/snappy to create pdf in windows

I am trying to create a PDF in Laravel 5.6 using Barryvdh/snappy. my config/snappy.php looks like

'pdf' => array(
    'enabled' => true,
    'binary'  => 'C:/xampp/htdocs/pdftesting/vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf',
    'timeout' => false,
    'options' => array(),
    'env'     => array(),
),

and my controller looks like,

        $pdf = PDF::loadView('pdf',$data);
        return $pdf->download('test.pdf');

But i get this error,

The exit status code '1' says something went wrong:\n stderr: "'C:/xampp/htdocs/pdftesting/vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf' is not recognized as an internal or external command,\r\n operable program or batch file.\r\n "\n stdout: ""\n command: C:/xampp/htdocs/pdftesting/vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf --lowquality --images --enable-javascript --javascript-delay "10" "C:\WINDOWS\TEMP\knp_snappy5ad430445b31e9.92776484.html" "C:\WINDOWS\TEMP\knp_snappy5ad430445fac87.79827170.pdf"

like image 544
Naveed Sheriffdeen Avatar asked Nov 29 '25 04:11

Naveed Sheriffdeen


1 Answers

try this solution https://github.com/barryvdh/laravel-snappy/issues/60 and look for STAMBOULI ABDELKARIM's comment, it worked out for me.

It's hard/impossible to generate charts using DomPDF, it was also pointed out by the developer Barryvdh