I installed wkhtmltopdf using apt and it put the executable in /usr/bin. However, the print module failed to recognize that it was installed. It kept telling me that no PDF tool was installed. I created a symbolic link in /sites/all/modules/print/lib to /usr/bin/wkhtmltopdf. The module maintainer said that this step is no longer necessary, but I went ahead and tried it anyways. And voila! After I created this symbolic link, the module immediately recognized the wkhtmltopdf library!
However, whenever I try to generate a PDF using the Print module, I get a bogus 2-3kb PDF that is un-openable by Adobe Reader.
I tried wkhtmltopdf via the command line and got an error stating that it couldn't connect to the X server or something like that. I found instructions here on how to fix that: #870058: Better wkhtmltopdf instructions
After following those steps, I was able to successfully generate a good PDF via the command line. Unfortunately, following those steps didn't resolve the problem with the Print module. It is still generating un-readable PDFs.
The only thing I see in the log is this:
wkhtmltopdf ["/usr/bin/wkhtmltopdf.sh" --page-size A4 --orientation portrait --dpi 96 --disable-local-file-access --footer-font-size 7 --footer-right '[page]' - -] (returned 1): No stderr output available.
I'm using Debian Squeeze/Debian Linux 6.0.
apt installed wkhtmltopdf 0.9.9
Comments
Comment #1
jonhy81 CreditAttribution: jonhy81 commented+ 1
Comment #2
trigdog CreditAttribution: trigdog commentedI was also having this same issue. I removed the default wkhtmltopdf options at admin/config/user-interface/print/pdf/wkhtmltopdf from:
--footer-font-size 7 --footer-right '[page]'
and just added this:
--quiet
This fixed the error for me. I am using the most recent version of wkhtmltopdf (0.12.2.1).
Comment #3
ferriol CreditAttribution: ferriol commentedI having this issue too, I'm using Debian Whezzy 7.8.
I installed wkhtmltopdf with apt-get
#2 solution doesn't work for me
I still have:
wkhtmltopdf ["/usr/bin/wkhtmltopdf" --page-size A4 --orientation portrait --dpi 96 --disallow-local-file-access --quiet - -] (returned 1): No stderr output available.
I execute in command line
Works !!
I have in print/lib
I don't know what I have to do.
It seems missing command xvfb-run
[UPDATE] I created the wkhtmltopdf.sh, mentioned here in print/lib directory and I created a symbolic link
ln -s wkhtmltopdf.sh wkhtmltopdf
And my pdf generation works !