Skip to content

Instantly share code, notes, and snippets.

@calebbrewer
Last active April 20, 2023 23:28
Show Gist options
  • Star 21 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save calebbrewer/aca424fb14618df8aadd to your computer and use it in GitHub Desktop.
Save calebbrewer/aca424fb14618df8aadd to your computer and use it in GitHub Desktop.
How to Setup wkhtmltopdf on CentOS 7
@muddassirnazir
Copy link

@KlimczakM
Copy link

gna.org has been shut down, is there any else mirror?

@RicardoJSTeixeira
Copy link

Same problem here

@adifatol
Copy link

Thanks! new one works!

@emilianoavendano
Copy link

Thank RicardoJSTeixeira, thanks a lot.

@mauricioperez
Copy link

Thanks Ricardo, fix the problem!

@albgen
Copy link

albgen commented Mar 7, 2020

./wkhtmltoimage html.it aaa1.png is creating a huge file. I stopped it at 500mb
Maybe a bug?

@Ranacse10
Copy link

Latest download links for centos 7 is https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos7.x86_64.rpm for Architecture: x86-64
then rpm -Uvh wkhtmltox-0.12.6-1.centos7.x86_64.rpm

@aipladmin
Copy link

wkhtmltopdf: error while loading shared libraries: libpng16.so.16: cannot open shared object file: No such file or directory
I am facing this error can anyone tell me how to get through this

@naveenslog
Copy link

I am also facing this error "wkhtmltopdf: error while loading shared libraries: libpng15.so.15: cannot open shared object file: No such file or directory"

@jaycom
Copy link

jaycom commented Sep 23, 2021

@cahalsall
Copy link

at the command line type "which wkhtmltopdf" without the quotes.

@Ranacse10
Copy link

Centos 8 download link
https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos7.x86_64.rpm
Centos 8 download link
https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos8.x86_64.rpm
Dependency (yum install fontconfig libXrender libXext xorg-x11-fonts-Type1 xorg-x11-fonts-75dpi freetype libpng zlib libjpeg-turbo)

Install by
rpm -Uvh wkhtmltox-0.12.6-1.centos8.x86_64.rpm
After successfully installed then you need to run

wkhtmltopdf https://github.com github.pdf (to Use wkhtmltopdf)

@Sylvain-Bugat
Copy link

To automatically install all the needed dependencies of wkhtmltopdf it's better to use the default yum package manager like that: yum localinstall <package>.rpm , example:
yum localinstall wkhtmltox-0.12.6-1.centos7.x86_64.rpm

@Ranacse10
Copy link

LocalInstall may not fill up all dependencies

@jlockman2
Copy link

I was able to install successfully using the below:

wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos7.x86_64.rpm

rpm -Uvh wkhtmltox-0.12.6-1.centos7.x86_64.rpm

@ajitsingh25
Copy link

The below commands fixed the issue for me

Make sure to remove below two packages first for the clean installations
yum remove -y wkhtmltopdf
yum remove -y wkhtmltox

And then execute below two commands
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos7.x86_64.rpm
yum localinstall wkhtmltox-0.12.6-1.centos7.x86_64.rpm

Verify
wkhtmltopdf --version

@JuanCarlosAguilarB
Copy link

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment