I am using the most recent dev version of Print module for a localhost installed version of drupal 6.17 on a Mac OSX 10.5.8 in a MAMP stack (Bitnami). I installed the wkhtmltopdf-0.10.0_beta4_OS-X.i386 version of wkhtmltopdf (after renaming it to wkhtmltopdf, and giving it execute permissions--chmod a+x). The wkhtmltopdf file is located in /sites/all/modules/print/lib/. I also put in a symlink to Xvfb, although I found that Xvfb does not need to be in print/lib anymore. I tested the wkhtmltopdf by running it on the command line in terminal, and it works fine. However, when I try to generate a pdf from a node in drupal, the page just reloads (no pdf is generated), and I get the following error in console:
Dyld Error Message:
Symbol not found: __cg_jpeg_resync_to_restart
Referenced from: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /Applications/mampstack-1.2-1/common/lib/libJPEG.dylib
I tried the fix suggested in http://www.brybot.ca/archives/Getting-Imagemagick-and-more-to-work-with-..., but that did not work.
The printer-friendly page works fine.
Any help would be appreciated.
Comments
Comment #1
jcnventuraThis is the same problem as #709644: wkhtmltopdf dblog error.
Comment #2
Dr Trichome commentedThank you for the fast reply! After a few hours of googling and trying different things, I finally stumbled on a solution that I wanted to share with others that may be having this problem. The error report from console suggested that the MacOS was trying to use its own libraries but was looking in the wrong directory. I looked in the /Applications/mampstack-1.2-1/common/lib and found that libpng.dylib was a symlink pointing to libjpeg.62.dylib. I removed this symlink and replaced it with a symlink to /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib. This worked (no more error messages about libJPEG.dylib). I had to do the same thing for libPng.dylib--make a libpng.dylib symlink in the /Applications/mampstack-1.2-1/common/lib directory pointing to /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib. Now the pdf version link on my drupal page produces a nice pdf!
Thanks for a great module!
Comment #4
citlacom commentedI was trying to use printpdf on MacOS and face the same problem of Dr Trichome, i did the explained steps to resolve my problem but lost few hours before to land here. I suggest to add some lines in the INSTALL.txt of the module alerting about this problem to make the wkhtmltopdf tool work on this environment.
Thanks for all, the module and this issue was helpful for me.
Comment #5
jcnventuraThis seems to be a documentation bug in wkhtmltopdf, not in the module integration.. That software package has a wiki which you can edit at http://code.google.com/p/wkhtmltopdf/w/list
I really don't want to start supporting wkhtmltopdf in all its platforms..