laravel-snappy: The exit status code '1' says something went wrong: stderr: "The system cannot find the path specified. "

I m using this code in controller but i m facing this error

public function getPDF()
{
    $pdf = PDF::loadView('ab');
    return $pdf->download('invoice.pdf');
}

error

The exit status code ‘1’ says something went wrong: stderr: "The system cannot find the path specified. " stdout: “” command: /usr/local/bin/wkhtmltopdf --lowquality “C:\Users\Admin\AppData\Local\Temp\knp_snappy552137b1a973a8.95135225.html” “C:\Users\Admin\AppData\Local\Temp\knp_snappy552137b1aa4969.49985920.pdf”.

capture

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 35 (2 by maintainers)

Most upvoted comments

Download and install wkhtmltopdf

Windows (MSVC 2013) 32-bit / 64-bit for Windows Vista or later; bundles VC++ Runtime 2013

from this link http://wkhtmltopdf.org/downloads.html

now copy wkhtmltopdf folder from program files and paste in c:/ drive now copy all the files from inner wkhtmltopdf folder and paste in c:/wkhtmltopdf folder

like this

wkhtmltopdf

now use this path in laravel snappy config file

‘binary’ => ‘C:/wkhtmltopdf/wkhtmltopdf.exe’,

config

Everything looks good for windows local server. But would you please tell us about real server where may do not available wkhtmltopdf. I like to use composer to install h4cc/wkhtmltoimage-i386 inside my vendor (project folder). It does not work in local server as well as real server. Its 32-bit operating system.

@umairali Really Thank you for you answer it works prefectly now 😃

My issue solved with command

‘binary’ => ‘C:/wkhtmltopdf/wkhtmltopdf.exe’,

When i am using this commands i m facing error

‘binary’ => base_path(‘vendor/h4cc/wkhtmltopdf-i386/bin/wkhtmltopdf-i386’)

I think this command is for linux only?

capture3

The exit status code ‘-1073741819’ says something went wrong: stderr: "Loading pages (1/6) [> ] 0% [======> ] 10% [=======> ] 13% Error: Failed to load http://www.google.com/jsapi, with network status code 3 and http status code 0 - Host www.google.com not found " stdout: “” command: C:/wkhtmltox/bin/wkhtmltopdf.exe --lowquality --enable-javascript --javascript-delay “5000” --enable-smart-shrinking --no-stop-slow-scripts

You can publish the config-file with

php artisan vendor:publish

Owh nice, works xD i forget to place to C:\

app cannot read whitespace C:\Program Files. thanks