Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception fired when generating from HTML #20

Closed
joseym opened this issue Sep 15, 2011 · 3 comments
Closed

Exception fired when generating from HTML #20

joseym opened this issue Sep 15, 2011 · 3 comments

Comments

@joseym
Copy link

joseym commented Sep 15, 2011

Based on the example in the readme, when I use generateFromHtml I get the following.

Fatal error: Uncaught exception 'RuntimeException' with message 'The file '/tmp/bill-123.pdf' was not created (command: /Users/jmorton/Sites/tests/wkpdf/wkhtmltopdf --lowquality "/var/folders/EH/EH1NBNSiGU0hy8p-WZ78Bo2kqHI/-Tmp-/knp_snappy4e7223ebe7a27.html" "/tmp/bill-123.pdf").' in /Users/jmorton/Sites/tests/wkpdf/Knp/Snappy/AbstractGenerator.php:260 Stack trace: #0 /Users/jmorton/Sites/tests/wkpdf/Knp/Snappy/AbstractGenerator.php(116): AbstractGenerator->checkOutput('/tmp/bill-123.p...', '/Users/jmorton/...') #1 /Users/jmorton/Sites/tests/wkpdf/Knp/Snappy/AbstractGenerator.php(126): AbstractGenerator->generate('/var/folders/EH...', '/tmp/bill-123.p...', Array, false) #2 /Users/jmorton/Sites/tests/wkpdf/index.php(14): AbstractGenerator->generateFromHtml('

Bill

<p...', '/tmp/bill-123.p...') #3 {main} thrown in /Users/jmorton/Sites/tests/wkpdf/Knp/Snappy/AbstractGenerator.php on line 260

If I try to have it send the pdf for download then the pdf is corrupted and wont open.

@NicholasGrey
Copy link

Tried for the first time today, was presented with the same error, found the problem was that wkhtmltopdf needs X to run, after abit of googling found this http://drupal.org/node/870058

@mbontemps
Copy link
Member

This is indeed something related to wkhtmltopdf and not Snappy

@benoitMariaux
Copy link

You can
sudo apt-get install xvfb

and it works with this line in config.yml :
binary: xvfb-run -a -s "-screen 0 640x480x16" wkhtmltopdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants