The wkhtmltopdf shell utility is used to generate PDF documents from HTML using WebKit. I’ve tried a few ruby gem wrappers that make use of wkhtmltopdf, but I’ve found that I like using the wicked_pdf gem the best. Regardless of what wrapper you use to call wkhtmltopdf, here are the steps to get wkhtmltopdf installed on Ubuntu (minor adjustments will be needed for non Debian based distributions).
1. Remove wkhtmltopdf installed using apt-get previously (if previously installed).
2. Install dependencies.
3. Download the static binary as per the architecture (i386/amd64). Extract it, change the owner and then copy it to /usr/local/bin.
tar xvjf wkhtmltopdf-0.9.9-static-i386.tar.bz2
sudo chown root:root wkhtmltopdf-i386
sudo cp wkhtmltopdf-i386 /usr/local/bin/wkhtmltopdf
Recommended References & Links: