Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wkhtmltopdf - cannot convert local file

I just downloaded version 10.0 for opensuse v. 11.3. I can convert a webpage (ie www.google.com) using it but cannot convert a local file. I grant all permissions on the file (& i've even tried running under sudo to no avail). This is the error:

"Loading pages (1/6) Error: Failed loading page file:///file.html".

The file exists but wkhtmltopdf refuses to load it. I even tried version 9.9 w/ the same result

What am I missing?

like image 351
user_78361084 Avatar asked Dec 29 '10 00:12

user_78361084


1 Answers

Just as a notice to any future people. I couldn't get the accepted answer working on Ubuntu 14.04, so I resorted to piping my HTML to the wkhtmltopdf command like so:

cat test.html | wkhtmltopdf - test.pdf

This is from the wkhtmltopdf command-line help:

Use - for stdin or stdout

like image 157
jdeanwallace Avatar answered Oct 06 '22 03:10

jdeanwallace