Potheek
Potheek

Reputation: 1021

WKHTMLTOPDF installation on web-server (hostgator)

I am interestingly stuck to install wkhtmltopdf on CentOS server (hostgator is the provider). I am relentlessly google-ing for details information on installation but haven't found any thing which can help some naive like me.

So, anyone out there to guide me through the installation on the server? Anykind of help would be highly appreciated. thanks in advance!

Upvotes: 1

Views: 2641

Answers (1)

Joel Peltonen
Joel Peltonen

Reputation: 13402

There are quite good instructions in a blog post I found http://blog.dakdad.com/post/13145939686/install-wkhtmltopdf-centos-5 - the version available in the repo is 0.9.9. If you are cool with that that option will work.

Edit: Because I'm a huge nerd I tested using a Virtual CentOS box and using the method above worked. I also wanted to test the static binary option too and got that way working too. The basic steps (I did them as root, it should work even without root access - depends a lot on your server):

# If you don't have wget installed
yum install wget

# get wkhtmltopdf binary. 
# browse the site to get the correct one for you
# if you don't know which one, run the command uname -a
# if it has things like x84_64, get the amd64 one. Otherwise i386.
wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.11.0_rc1-static-amd64.tar.bz2

# unpackage binary 
bunzip2 wkhtmltopdf-0.11.0_rc1-static-amd64.tar.bz2

# untar
tar xvz wkhtmltopdf-0.11.0_rc1-static-amd64.tar

# make sure you have the file, the file list should contain wkhtmltopdf-amd64
ls

# run to check version, output should contain "wkhtmltopdf" 0.11.0 rc1
./wkhtmltopdf-amd64 -V 

There you have your very own static package. I tested it with

./wkhtmltopdf-amd64 http://www.google.cn googl.pdf

It worked! The chinese characters fail because I don't have anything else installed on the CentOS box, I would propably need fonts and whatnot but the PDF was indeed created and looked ok.

Good luck, have fun.

Upvotes: 1

Related Questions