Question

I'm trying to generate a PDF file based on an HTML file in a Rails app. I search and I found this wkhtmltopdf engine, but when I try to generate a pdf appending the '.pdf' sufix in my pages it seems to be in a loop that never ends unless I stop the server, which show this error:

command failed: "/usr/bin/wkhtmltopdf" "--page-size" "Letter" "--margin-left" "0.75in" "--margin-right" "0.75in" "--margin-bottom" "0.75in" "--margin-top" "0.75in" "--encoding" "UTF-8" "--quiet" "-" "-"

I'm using pdfkit and wkhtmltopdf-binary gems and MacOS Lion. Does anyone knows how to solve this issue? Thanks

Was it helpful?

Solution

if you follow the exact instructions HERE then your issues should go away. I've used this on several projects without issue. You should also know that there is an issue with scaling content should you happen to deploy to ubuntu and that you need to update wkhtmltopdf.

OTHER TIPS

Yes.. had this too. There is a bug in the gem version of wkhtmltopdf. Download the current release and the convert call will eventually come back.

http://code.google.com/p/wkhtmltopdf/downloads/detail?name=wkhtmltopdf.dmg&can=2&q=

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top