wkhtmltopdf Issue-Collection of common programming errors

1) I uploaded”wkhtmltopdf-i386″ to my server in a folder named “/pdf”

2) I uploaded the php integration script, in the same folder, and named it “wkhtmltopdf.php” (http://code.google.com/p/wkhtmltopdf/wiki/IntegrationWithPhp)

3) I uploaded a file that I named “usage.php”, in the same folder, containing :


4) I created a /tmp folder with 777 permissions (all).

When I load usage.php, I get the following error:

"Fatal error: Uncaught exception 'Exception' with message 'WKPDF didn't return any data. 
' in /home/***/public_html/dev/pdf/wkhtmltopdf.php:205 Stack trace: #0 /home/***/public_html/dev/pdf/usage2.php(5): WKPDF->render() #1 {main} thrown in /home/***/public_html/dev/pdf/wkhtmltopdf.php on line 205"

For your info, a html page is rendered in /tmp folder each time I load usage.php.

Do you have any clue on how to solve my issue?

Thanks

  1. Have you tried looking inside your wkhtmltopdf.php?

    Make sure that this line:

    /**
     * path to executable
     */
    protected $_bin = '/usr/bin/wkhtmltopdf';
    

    is not /usr/bin/wkhtmltopdf but is the absolute path where you put your wkhtmltopdf-i386.

    In your case, perhaps it’s /pdf/wkhtmltopdf-i386.

Originally posted 2013-11-27 05:08:24.