Help installing static binary for wkhtmltopdf

2019-02-01 23:51发布

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

4条回答
Rolldiameter
2楼-- · 2019-02-02 00:31

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.

查看更多
Luminary・发光体
3楼-- · 2019-02-02 00:32

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!

查看更多
Explosion°爆炸
4楼-- · 2019-02-02 00:38

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"

查看更多
手持菜刀,她持情操
5楼-- · 2019-02-02 00:43

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.

查看更多
登录 后发表回答