1

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!

Potheek
  • 991
  • 1
  • 8
  • 17
  • Not yet, all those documentation out there is not so beginner friendly. They seemed to assume that everyone knows linux commands and have server experiences :( – Potheek Jul 18 '12 at 08:43
  • I really hope you have shell access to the server , I tested two different methods of installing wkhtmltopdf and got them both up an running before I realized that you are using a hosting provider instead of your own server :P – Joel Peltonen Aug 15 '12 at 14:32
  • Any news? Did you manage to get it working? – Joel Peltonen Jan 16 '15 at 12:28

1 Answers1

1

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.

Joel Peltonen
  • 13,025
  • 6
  • 64
  • 100
  • This answer is really general, as there are tons of ways to do this - I guess it would even be possible to install aptitude and then get the ubuntu repositories and do `apt-get install wkhtmltopdf`. Do you have some specific requirements or problems, have you specifically tried installing already in some way? – Joel Peltonen Aug 15 '12 at 12:17
  • thanks @Nenotlep for help. I am going to try your instruction and let you know. Cheers! :) – Potheek Aug 16 '12 at 05:29
  • 1
    This was super helpful in an internet with very little support on these topics. Thank you. Just to note, hostgator uses centos 6 now and the rpm file installation will work fine in cgi-bin for anyone else who comes across this. – thekevshow Jan 16 '15 at 03:20