I have downloaded and copied both binaries for both wkhtmltopdf and Xvfb in an appropriate directory, but when I select wkhtmltopdf as the PDF creation tool nothing happens: the page reloads and stays the same.
When I look at the Drupal logs it seems that there is a permissions issue, this is the message I get:
wkhtmltopdf: sh: myinstalldirectory/sites/all/modules/print/lib/wkhtmltopdf/wkhtmltopdf: Permission denied
Do you have any idea of which permissions I should grant in order to make it work?
Thanks in advanced
| Comment | File | Size | Author |
|---|---|---|---|
| #22 | 27-5-2010 15-20-08.png | 5.97 KB | open social |
| #21 | goalgorilla.pdf | 143.94 KB | open social |
Comments
Comment #1
jcnventuraThat seems to be a permission denied issued by the Linux shell.. Can you do 'ls -l' of the myinstalldirectory/sites/all/modules/print/lib/wkhtmltopdf directory, and tell me the permissions string (should be a mix of rwx).
It may be that the sh user doesn't have permissions to execute the file.. Maybe do a chmod to grant him execution permissions?
João
Comment #2
castawaybcn commentedwow, that was a quick answer!
it definitely is a linux box, but in a shared host. The only way to access it would be through ssh but I'm afraid this is not an option for now. I can however change the permissions through the cpanel interface. But I don't know what permissions I should be applying. I tried 0774 and got rid of the error message but still no pdf is generated, any suggestions?
ta
Comment #3
jcnventuraIf you got rid of that error message, then you are now able to (maybe) execute it. If no PDF is generated, it means that an error occurred somewhere in the process.. I believe I try to catch any error message from the process and turn it into a Drupal log message. Do you have other messages in the log?
Comment #4
castawaybcn commentednope, that's what puzzles me. I have absolutely no clue to what's happening.
Comment #5
jcnventuraDoes the request terminate in an empty page? Does it go back to the original page? Or does it just keep waiting for the server to respond??
João
Comment #6
castawaybcn commentedit just goes back to the original page, from a user's point of view it looks as if you reloaded the page.
Comment #7
jcnventuraOK..
That means that the output of the wkhtmltopdf was empty. However, if there were any error messages, they should have been reported in the Drupal log..
So no logs and no PDF.. Absolutely nothing to know where the problem is :)
Without shell access it's impossible to ask you execute the binary directly or even to check the running process list.. Maybe I can recommend using TCPDF...
João
Comment #8
castawaybcn commentedI tried, but it does not seem to find neither my print_logo nor work well with the Brilliant Gallery Module... The first I could live with, but not the second (nothing gets printed at all)
Comment #9
Rustan commentedI have the exact same situation, running on a shared linux server, just updated print and wanted to try this new variant. I've configured print so that the pdf shall open in a new window, but in that window the page with the link reloads, and no pdf is shown. I used tcpdf fine with previous version, but have not installed it when updating print.
I have shell access, but have severe resritctions on it so far from an ideal test environment. Some programs that do work over the web do not work from the shell. I used what ought to be the correct Xvfb, but I do not have access to uname...
Anything I can try?
Comment #10
xurubo93 commentedI managed to get wkhtmltopdf running on my webserver, but it was not only done by copying the static binaries into a folder. I installed a lot of packages which are prerequisites for this tool.
In your case I think the glibc-library is missing on your linux machine. This package provides the ld-linux library.
So i guess that using wkhtmltopdf is restricted to those people who have root access to the webservers.
Comment #11
jcnventura@Rustan: The binary of Xvfb which you have in the site doesn't seem to be linked with the same libraries as the rest of your system.. I would guess that you have to upload a static version of Xvfb or re-compile Xvfb in your system. Maybe you can ask your shared host provider if they can install Xvfb for you in the system...
@xurubo93: Specifically the requirement for a running X server is a major annoyance. I would guess 99% of shared hosting users will not be able to get wkhtmltopdf running.
João
Comment #12
Rustan commentedNope, no luck there, the host do not want to install xvfb. I will continue using tcpdf, so no problem for me. Just wanted to help with testing :)
Comment #13
jcnventuraTwo weeks without further info. Closing the issue.
Comment #14
ggamba commentedHi Joao, I'm in the same situation of castawaybcn, no logs and no PDF, but I have shell access. I had to specify the font path for xvfb and had to manually create /etc/X11/xserver/SecurityPolicy. Maybe I did something wrong but I can't see the failing output...what should be the command to execute the binary directly?
Thanks and best
Gabriele
Comment #15
ggamba commentedComment #16
jcnventuraThe output should be in the Drupal error logs..
As to the direct command line:
wkhtmltopdf --page-size [a4|letter] --orientation [portrait|landscape] --dpi 96 --footer-font-size 7 --footer-right '[page]' - -Comment #17
ggamba commentedjcnventura, thank you for your reply!
Unfortunately, since I specified the font path with -fp there is no output in Drupal error logs.
I launched the following command:
"/var/www/drupal6.x/sites/all/modules/print/lib# ./wkhtmltopdf --page-size a4 --orientation portrait --dpi 96 --footer-font-size 7 --footer-right 'http://...' - -"
but nothing happened. A pdf should be generated in /var/www/drupal6.x/sites/all/modules/print/lib ? No pdf and no errors... any hint?
Thanks
Gabriele
Comment #18
jcnventuraSorry, the command line can't be like what I specified as that will take input from standard input and output to standard output. Try to read wkhtmltopdf instructions and don't use the final '- -', as that's only useful inside the module.
As to the -fp, that only removes some errors/warnings that you had before.. So if there's no errors reported in the logs, it's because the processes are not producing any error. Which is strange, as you're not getting any PDF..
Comment #19
ggamba commentedI went back to DomPDF: I'll try again wkhtmltopdf when an Ubuntu package will be released.
I had a look at the Debian package (http://packages.debian.org/unstable/utils/wkhtmltopdf ) and once realized that I had to update tons of libraries, I decided to wait.
Comment #20
jcnventuraNo further info in 2 weeks. Closing the issue.
Comment #21
open social commentedWe are running into the same issues.
First we followed the Handbook installing wkhtmltopdf. This went well. We performed the commando
commando: wkhtmltopdf http://www.goalgorilla.com/ goalgorilla.pdf
(result is attached, so a good start)
But the Module did not recognize wkhtmltopdf yet. So we performed step 2 and 3 from the Handbook (Place the wkhtmltopdf executable and Xvfb binary into the print module lib directory).
Now the module recognises wkhtmltopdf. But we got the reload error mentioned in post #0 and in our Drupal access log:
So we created /usr/lib64/xserver/SecurityPolicy and the RGB_DB is in rgb.txt and placed in the right directory.
The module still doesn't work. The only message in our log states:
So on the console the app works and we have nothing in the errorlog of the domain. Is there more logging in Drupal we can check or does anybody has an idea to fix the issue? We really appreciate your time and efforts!
Comment #22
open social commentedTurns out it already worked. You need to DISABLE the 'Send to printer' functionality in the Web Page print tab of the module admin.
Comment #23
jcnventuraPlease don't re-open old issues.. Anyway the "Send to printer" problem with wkhtmltopdf has now been fixed.