12

I am trying to use the static binary of wkhtmltopdf on Ubuntu server 10.0.4. The reason for is that it apparently has a built in modified QT that will allow me to run wkhtmltopdf without an X Server.

Result: Once installed (see steps below), when I execute wkhtmltopdf in the terminal, it does not fire up... just returns me to the prompt - like it ran and did something, no error but no output:

:/usr/bin$ wkhtmltopdf

:/usr/bin$

Same behavior if I put args:

:/usr/bin$ wkhtmltopdf http://www.google.com test.pdf

:/usr/bin$

Am I doing something wrong --- my understanding that the static binary should just fire up. Perhaps missing some dependency? Is there a way to get some verbose output?

These are the steps I have followed:

In /usr/bin:

1) Confirmed that the existing (non-static) wkhtmltopdf resides there and that it executes. When I execute it with no args I get the help/about output from the app.

2) Moved the existing wkhtmltopdf out of the directory (renamed it)

3) Get the static binary: sudo curl -C - -O http: //wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-i386.tar.bz2

4) Untar: tar xvjf wkhtmltopdf-0.9.9-static-i386.tar.bz2

5) Rename: mv wkhtmltopdf-i386 wkthtmltopdf

6) Get (apparently) necessary packages: sudo apt-get install openssl build-essential xorg libssl-dev

2
  • Make sure you are using the correct binary. If you're not sure try the amd64 binary instead and see if it works.
    – Greg
    Oct 4, 2010 at 12:59
  • Did you ever solve this? I am having EXACTLY the same issue! Jul 16, 2013 at 20:18

4 Answers 4

23

I was having the same problem. I removed the existing wkhtmltopdf and followed the steps below and the installation worked.

First, installing dependencies

sudo aptitude install openssl build-essential xorg libssl-dev

for 64-bit OS

wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.2-static-amd64.tar.bz2

tar xvjf wkhtmltopdf-0.9.2-static-amd64.tar.bz2

chown root:root wkhtmltopdf-amd64

mv wkhtmltopdf-amd64 /usr/bin/wkhtmltopdf

The only difference is that I put it in /usr/local/bin/wkhtmltopdf.

I hope this helps!

2
  • 1
    Doesn't that just install the xorg XServer to your box? So the install is still using an XServer, right?
    – pcurry
    Dec 27, 2013 at 19:03
  • Instead of full X, you can pull only the libxrender: apt-get install libxrender1
    – b4d
    Nov 6, 2017 at 11:02
2

Following deb's answer got it working for me on Ubuntu 10.04 64bit - thanks!

Although rather than downloading 0.9.2 as per deb's instructions, I would suggest people download the latest version by:

  1. Go to http://code.google.com/p/wkhtmltopdf/downloads/list
  2. Download the latest version of wkhtmltopdf-[version number]-static-amd64.tar.bz2

At this time, the latest 64bit is http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.11.0_rc1-static-amd64.tar.bz2.

1
0

In my debian server trying to run wkhtmltopdf-i386 lead to same blank prompt.

Non-static (with non-patched QT) version of wkhtmltopdf installed with "aptitude install wkhtmltopdf" is worked.

Problem solved by switching to wkhtmltopdf-amd64, server was a 64 bit and i missed it.

After that, wkhtmltopdf-amd64 says 'libxrender shared library not found', this problem was solved by "aptitude install xorg"

0

0.11.0_rc1 seems to be buggy.
It keeps throwing the error "Cannot create a QPixmap when no GUI is being used".
Reverting to 0.9.9 worked for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.