Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I updated to 6.1.11 and now when I click on the PDF icon, the page refreshes but not PDF is created.
I noticed in the status report that I has an error "The currently selected version of wkhtmltopdf () is not supported. Please update to a newer version." I was running 0.10.0_beta4 which was working before I updated the module. I uploaded 0.10.0_beta5 but I am still receiving the error.
As a precaution, I uninstall the Print module and reinstalled but the results are the same.
I downloaded wkhtmltopdf from http://code.google.com/p/wkhtmltopdf/downloads/detail?name=wkhtmltopdf-0...
Comments
Comment #1
jcnventura CreditAttribution: jcnventura commentedIn which operating system are you? That warning was supposed to appear in wkhtmltopdf earlier than 0.9.6. I tested it in 0.10.0_beta4 and it worked for me.
João
Comment #2
2ndmile CreditAttribution: 2ndmile commentedOS: Linux
Apache: 2.2.15
PHP: 5.2.9
Comment #3
jcnventura CreditAttribution: jcnventura commentedWell, then it wasn't because of that...
João
Comment #4
2ndmile CreditAttribution: 2ndmile commentedFor kicks, I commented out that check in the print_pdf.module file. Error gone in status update obviously but original problem persists, NO pdf created and page just refreshes.
Comment #5
jcnventura CreditAttribution: jcnventura commentedThe module should have reported the currently detected version in those parentheses.. The fact that it didn't is the problem.. In my case it
The module also denies any possibility of running an old version by returning the user to the original page instead of generating the PDF, and that's why it refreshes the page in your case.
Can you please run "wkhtmltopdf --version" and paste here the contents of the reply?
And if you're feeling a bit more adventurous, can you please replace the following line nearly at the end of print_pdf.module:
$out = preg_match('!.*?(\d+\.\d+\.\d+).*$!m', stream_get_contents($pipes[1]), $matches);
with
$out = preg_match('!.*?(\d+\.\d+\.\d+).*$!sm', stream_get_contents($pipes[1]), $matches);
and see if that fixes it?
João
Comment #6
2ndmile CreditAttribution: 2ndmile commentedFor further testing/troubleshooting, downgraded to 0.10.0_beta4 but problem persists, page refreshes no PDF created.
Comment #7
2ndmile CreditAttribution: 2ndmile commentedCrap... forgot to change permissions for wkhtmltopdf to be executable. Fixed refresh problem and the error in the status report is no longer showing up.
It had been a while since my original install so I forgot about this step. You may want to update the INSTALL.txt to say that this file must be executable on the server... seems like an obvious thing, but obviously not.
I have another problem but I will open a new issue.
Comment #8
Anonymous (not verified) CreditAttribution: Anonymous commentedI'm still experiencing this problem with OS X version of wkhtmltopdf. Output of --version:
Name:
wkhtmltopdf 0.10.0 beta4
Drupal 6.19
Print 6.x-1.11
I tried replacing the regular expression per instructions in #5, but no change. No version information is reported on the status report other than "unsupported version"
I've verified that wkhtmltopdf has executable permissions.
Comment #9
jcnventura CreditAttribution: jcnventura commentedThis seems to be a OS X-only problem..
I don't have access to a Mac, so I have no idea how to fix the problem. Anyway, please create a new issue, as the original one is now fixed.
Comment #11
t14 CreditAttribution: t14 commentedHi have a similar problem on a windows platform
Any ideas how I can debug the problem.
Basically when I click the pdf link I get the page jus refreshes in a new window
I was using wkhtmltopdf version 0.9.9 and I have also tried version 0.10.0 beta 5 but no improvements
Thanks in advance for your help
Comment #12
jcnventura CreditAttribution: jcnventura commentedDo you get a warning in the status report?
Comment #13
t14 CreditAttribution: t14 commentedif you mean the drupal system log entries
Then no there is no warning
Comment #14
jcnventura CreditAttribution: jcnventura commentedNo, I mean the status report at admin/reports/status
Comment #15
t14 CreditAttribution: t14 commentedah ok,
Yes it says:
"The currently selected version of wkhtmltopdf () is not supported. Please update to a newer version."
I am currenlty using version 0.10.0 beta5
What version do you recommend?
Comment #16
jcnventura CreditAttribution: jcnventura commentedThe module was unable to execute wkhtmltopdf.. I don't know why, but you can try to take a look at #911156: warning: proc_open() ... Create Process failed.
Comment #17
Matthew Davidson CreditAttribution: Matthew Davidson commentedTrying to get the version number from the command line:
So
apt-get install libxrender1
fixed the problem for me.Comment #18
jcnventura CreditAttribution: jcnventura commentedNo further info in more than two weeks. Closing the issue.
Comment #19
jayjaydluffy CreditAttribution: jayjaydluffy commentedHi! I've seen this thread and been trying to fix the same problem I have in my shared server using the methods by which you guys recommended to deal with the problem.
I have this specs in my shared host:
CentOS release 5.5 (Final)
x11 client lib is already installed => from technical support
PHP 5.2.14
Apache/2.2.16
x86_64 architecture
I'm still getting this error: "The currently selected version of wkhtmltopdf () is not supported. Please update to a newer version." even after I tried the fix above @ #5
I tried -i386 and -amd64
http://code.google.com/p/wkhtmltopdf/downloads/detail?name=wkhtmltopdf-0...
http://code.google.com/p/wkhtmltopdf/downloads/detail?name=wkhtmltopdf-0...
but I still go the same error. I also tried commenting out some lines of print_pdf.module where it seeks about file version, so after saving, the error disappeared in Status Report page, but NO PDF is CREATED and the page just refreshes after creating book.
Can someone help me out here, again. Thank you so much!
Comment #20
cmrabet CreditAttribution: cmrabet commentedHi, getting the same issue here:
- Mac OS
- Last BETA version of wkhtmltopdf
When /site/printpdf/nid no PDF is generated, and the node pages just refreshes.
Thanks.
Comment #21
iuk2 CreditAttribution: iuk2 commentedI am having the same issue. My operating system is Linux.
When I use the following command line
sudo ln -s /opt/wkhtmltopdf
it generated a PDF page. But when I click PDF icon, nothing happens; it appears that page is just refreshed.
Thanks in advanced.
Comment #22
ice5nake CreditAttribution: ice5nake commentedThis issue appears to be caused by the _print_pdf_wkhtmltopdf function in the module. Because this code hits the drupal_goto because the $version variable is empty.
This code is pulled from print_pdf.pages.inc
So I commented that code out and then I just hit a later drupal_goto because the $pdf variable is empty. So whether or not you get this error is probably dependent upon which version of wkhtmltopdf you are using. I've tried both versions on their site currently, 0.10.0_rc1 and 0.9.9
I also dumped the content of the $cmd variable to a HTTP header so I could see it.
/opt/wkhtmltopdf --page-size A4 --orientation portrait --dpi 96 --footer-font-size 7 --footer-right '[page]' - -
Comment #23
ice5nake CreditAttribution: ice5nake commentedIt checks the version in print_pdf.pages.inc too. I commented both out and it still doesn't work. Thinking I might have to try the dompdf route instead.
Comment #24
ice5nake CreditAttribution: ice5nake commentedI am getting "wkhtmltopdf: sh: /usr/bin/wkhtmltopdf: Permission denied" in my Drupal log.
I ran
sudo -u apache wkhtmltopdf http://inordinatemind.com /var/www/html/sites/default/files/wkhtml-test.pdf
and it worked just fine. I am using wkhtmltopdf 0.10.0 rc1 and PHP 5.3
It failed the is_executable PHP function too though and I had to comment that out.
The permissions are set to allow.
Comment #25
ice5nake CreditAttribution: ice5nake commentedI asked a related question here:
http://stackoverflow.com/questions/4216596/php-function-is-executable-re...
Comment #26
ice5nake CreditAttribution: ice5nake commentedIn case anyone is following this thread. SELinux can block wkhtmltopdf from working through PHP even though it may be working at the command line level.
Comment #27
jayjaydluffy CreditAttribution: jayjaydluffy commentedI just have PDF printing working again when I changed hosting service! The former hosting service blocked some PHP functions that wkhtmltopdf is using, thus making the binary unexecutable and/or in some cases, not supported version!
I think that was proc_open() function that they blocked. They said it's for security reasons they restricted execution of that function. They tried to unblock that to us, but the more things messed up and PDF creation was still unattainable.
Maybe you could go on looking for other hosting services, if necessary.
Comment #28
drupalnesia CreditAttribution: drupalnesia commentedI have update the Documentation of http://drupal.org/node/306882 according to #7:
- IMPORTANT: make sure you give executable permission such as 755 to wkhtmltopdf file
@jcnventura: the incompatible version of wkhtmltopdf message may be wrong, I use wkhtmltopdf-0.9.9-static-amd64 but still error. I will check why not running well while my other server can run wkhtmltopdf-0.9.9-static-amd64.
#26: interested! need confirmation to include to Print module documentation
#27: I will check required php functions and will update the Documentation
Comment #29
drupalnesia CreditAttribution: drupalnesia commentedAdded to FAQ http://drupal.org/node/190173#wkhtmltopdf_version
Comment #30
jcnventura CreditAttribution: jcnventura commented@jayjaydluffy, @ice5nake: glad to know you fixed it.
@drupal-id.com: thanks for improving the documentation!
Comment #32
charlie-s CreditAttribution: charlie-s commentedI've tried without luck to get wkhtmltopdf working on a new server. It was working on the old system (CentOS) but we recently migrated to a VPS.net Ubuntu server and the problem began. The wkhtmltopdf binary in sites/all/modules/print/lib wasn't modified, and I verified that it is 755. Executing the program from terminal gave no response; as did "wkhtmltopdf -V" or "wkhtmltopdf --help". I verified I have X11 and QT4 installed. I also have Xvfb with a symlink pointing from ./lib to the binary in /usr/bin.
Nothing in the Drupal or system logs when I attempt to run the program manually or from node/x/pdf.
I deleted my wkhtmltopdf binaries and grabbed a new static binary from the Google Code repository (0.10.0) but I'm experiencing the same results.
Any ideas or suggestions? Thanks for any help.
Comment #33
charlie-s CreditAttribution: charlie-s commentedI've tried 0.9.9 static and 0.10.0_rc2 in my /lib/ folder but still receive "The currently selected version of wkhtmltopdf () is not supported. Please update to a newer version." This error message needs to be fixed in the code, since it's apparently not doing any version checking.
Comment #34
jcnventura CreditAttribution: jcnventura commentedIt is checking the version perfectly.. If your wkhtmltopdf binary were able to get executed, you'd see the version between the parentheses.. The module runs wkhtmltopdf -V and tries to read the version number there..
Comment #35
charlie-s CreditAttribution: charlie-s commentedIt's executable but "wkhtmltopdf -V" returns a new line, nothing is outputted. I will switch to dompdf.
Comment #36
Zsuffa Dávid CreditAttribution: Zsuffa Dávid commentedI had the same issue, page reload no pdf generated and the error message 'sh: /wkhtmltopdf-i386 not found'
It was caused by
I changed the safe_mode_exec_dir to point to "/var/www/..../modules/print/lib" and the pdf is downloading.
david
Comment #37
SchwebDesign CreditAttribution: SchwebDesign commentedsubscribing, having same issues here... followed instructions at faq http://drupal.org/node/190173#wkhtmltopdf_version : both the issue with the page just refreshing and the Unsupported version message.
my versions:
wkhtmltopdf-0.10.0_rc2-static-amd64
drupal 6.22
print 1.14
WHM 11.30.4 (build 6)
CENTOS 5.7 x86_64
Apache/2.2.19
PHP 5.2.17
Do i "need" to follow the instructions here? http://code.google.com/p/wkhtmltopdf/wiki/compilation
Comment #38
guerrilla CreditAttribution: guerrilla commentedHey!
Try out this:
replace row:
$cmd = realpath($print_pdf_pdf_tool) . ' --version';
with this one:
$cmd = '"' . realpath($print_pdf_pdf_tool) . '"' . ' --version';
in function "_print_pdf_wkhtmltopdf_version" ("print_pdf.module" file)
Possible that you'll also need to copy dll's from installation dir to libraries dir (I had an error that libgcc_s_dw2-1.dll is missing and copied all of them).
This helped me. And now I had another error... But this is another story :)
Comment #39
guerrilla CreditAttribution: guerrilla commentedHey!
If that helped, you also need to replace row number 382 in print_pdf.pages.inc:
$cmd = realpath($print_pdf_pdf_tool) . " --page-size $print_pdf_paper_size --orientation $print_pdf_page_orientation --dpi $dpi $print_pdf_wkhtmltopdf_options - -";
with this one:
$cmd = '"' . realpath($print_pdf_pdf_tool) . '"' . " --page-size $print_pdf_paper_size --orientation $print_pdf_page_orientation --dpi $dpi $print_pdf_wkhtmltopdf_options - -";
I won! :) Worked!!!
Comment #40
jcnventura CreditAttribution: jcnventura commentedAh, the joys of using Windows.. I've added the double quotes in those lines..
Anyone else, please don't reopen this thread.. Open a new one please.
Comment #41
anneeasterling CreditAttribution: anneeasterling as a volunteer commentedLeaving this tip here for future searchers.
Symlink from /usr/bin/wkhtmltopdf to folder in /sites/all/libraries/wkhtmltopdf may be needed. There may be other ways to do it, but that's the only thing that worked for us.