Skip to content

Instantly share code, notes, and snippets.

@apphancer
Last active May 31, 2020 21:58
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save apphancer/8654e82aa582d1cf02c955536df06449 to your computer and use it in GitHub Desktop.
Save apphancer/8654e82aa582d1cf02c955536df06449 to your computer and use it in GitHub Desktop.
Install wkhtmltopdf 0.12.4 on CentOS 6.x and 7.x
# Install dependencies (if needed)
$ yum install -y xorg-x11-fonts-75dpi
$ yum install -y xorg-x11-fonts-Type1
$ yum install xz
# Get latest version of wkhtmltopdf (replace version number if needed)
$ wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
# Untar and move wkhtmltox
$ unxz wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
$ tar -xvf wkhtmltox-0.12.4_linux-generic-amd64.tar
$ mv wkhtmltox /usr/bin/wkhtmltox
# Add wkhtmltopdf to .bash_profile (optional)
nano .bash_profile
# Add the following line at the end of the .bash_profile file
# export PATH=/usr/bin/wkhtmltox/bin:$PATH
# And don't forget..
$ rm wkhtmltox-0.12.4_linux-generic-amd64.tar
# Finally enjoy!
$ wkhtmltopdf http://www.google.com google.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment