HOWTO: install wkhtmltopdf on Centos7 [including headless servers, and fonts]

4,123 views
Skip to first unread message

Al J

unread,
Feb 13, 2016, 12:51:19 PM2/13/16
to wkhtmltopdf General

as root

------------------------------------------------------

wget the latest version


untar it (tar knows about compression now, you don't need to mention what type)

tar vxf wkhtmltox-0.12.3_linux-generic-amd64.tar.xz

rsync it into the /usr/local tree, preserving symlinks (have to do it this way because it was tarred from a subdirectory)

rsync -vlr wkhtmltox/* /usr/local/

symlink the binaries into /usr/bin (or adjust your path)

ln -s /usr/local/bin/wkhtmltopdf /usr/bin/wkhtmltopdf
ln -s /usr/local/bin/wkhtmltoimage /usr/bin/wkhtmltoimage

test it

wkhtmltopdf -V
wkhtmltopdf 0.12.3 (with patched qt)

------------------------------------------------------

To run this headless (no gui on your server?) you will want xvfb



I also had to install these:

yum install -y zlib fontconfig  freetype libX11  libXext libXrender

Then it worked

wkhtmltopdf -V
wkhtmltopdf 0.12.3 (with patched qt)

------------------------------------------------------

Need fonts?  everything coming up squares?

yum install -y ghostscript

Paris Ambush

unread,
Feb 16, 2016, 7:35:22 PM2/16/16
to wkhtmltopdf General
I followed these steps and got the following error:
wkhtmltopdf: /lib64/libc.so.6: version `GLIBC_2.9' not found (required by wkhtmltopdf)
wkhtmltopdf: /lib64/libc.so.6: version `GLIBC_2.10' not found (required by wkhtmltopdf)
wkhtmltopdf: /lib64/libc.so.6: version `GLIBC_2.7' not found (required by wkhtmltopdf)

I noticed that doing yum install on those libraries had no effect as there were already present and up to date.

I'm on Red Hat Enterprise Linux Server release 5.4 and am using wkhtmltopdf version 0.12.3. Was redirected to try this from the RHEL thread earlier.

Ramon Fernandes Roque

unread,
Mar 1, 2016, 12:13:34 PM3/1/16
to wkhtmltopdf General
I am having the same problem.

Joshua Atlee

unread,
Aug 6, 2016, 8:48:20 AM8/6/16
to wkhtmltopdf General
Follow above, install epel repo then install wkhtmltopdf, works perfectly fine.

Joshua Atlee

unread,
Aug 6, 2016, 8:49:44 AM8/6/16
to wkhtmltopdf General


On Saturday, August 6, 2016 at 10:48:20 PM UTC+10, Joshua Atlee wrote:
Follow above, install epel repo then install wkhtmltopdf, works perfectly fine.

I mean skip the tar version and just install epel then install wkhtmltopdf then install below this.
Reply all
Reply to author
Forward
0 new messages