views:

119

answers:

0

First off, I will acknowledge that I am aware of another similar thread on the topic of wkhtmltopdf, but it was not similar enough to resolve my issue. Here's the other thread: wkhtmltopdf

Second, I will say that I have successfully used wkhtmltopdf with a Drupal site on a dedicated server that I run, where I installed the libX11 and used the most recent static version of wkhtmltopdf. That's on a CentOS 5 system and it runs nicely.

So, I have another hosting arrangement and I need to get the wkhtmltopdf to work, because it does the most amazing job producing bookmarked PDFs. The PDFs are beautiful.

The hosting is cPanel. I determined that it is on a server that has CentOS 5.5. It is not a problem to drop the static wkhtmltopdf in the print module's lib folder. However, I get the following message back in the Drupal admin status reports page (admin/reports/status).

It says, "wkhtmltopdf library The currently selected version of wkhtmltopdf () is not supported. Please update to a newer version."

I have obtained all of the needed .so files for CentOS 5, based on what jockie provided in his answer in the other StackOverflow thread.

Can someone knowledgeable confirm that his list was complete?

The idea of a shell script wrapper seems interesting and appears could be done for Drupal, if the naming of the shell script is called something like "wkhtmltopdf-wrapper.sh".

I have tried to use the shell script code that jockie provided, in a shell script. I did place all of the .so files in a sub-folder called "lib". I confess that I do not know what such things mean, in the script:

export HOME="$PWD"

Can someone interpret for me, what $PWD means?

export LD_LIBRARY_PATH="$PWD/lib/"

I understand that the script is going to get the .so files with that line, yes?

And can someone interpret the following line:

exec $@ 2>/dev/null

What I am wondering is, where does the actual pdf get output? I did run the script. It did not throw any errors. However, I did not see a resulting PDF file.

Also, jockie's directions are not totally clear or defined enough. He says, "(some of them are symlinks)" under the list of .so files. Are such lines (in his list), the symlinks?:

lib/libX11.so.6 lib/libX11.so.6.2.0

Or am I mistaken? I was able to get all of them, so I don't know why they would be symlinks. The only thing is, that some of the versions are different. Do I need to delete the following files and make symlinks instead?:

  • lib/libX11.so.6
  • lib/libXau.so.6
  • lib/libxcb.so.1
  • lib/libXext.so.6

Should the shell script code be written differently, with Drupal in mind?

Thanks for reading and I hope someone can help!

...Finally, if anyone knows of a better solution, please share! Again, I appreciate the help!

...There does not seem to be a way, here on StackOverflow.com to notify jockie to check out this thread. I wish there was a way to write to them or notify them, so that they could clarify for them-self or contribute to this thread as well. If someone knows of a way, please let me know that too!

related questions