You can download this article in PDF format via the link below to support us.
Download the guide in PDF format turn off
wkhtmltopdf and wkhtmltoimage are open source (LGPLv3) command-line tools for rendering HTML into PDF and various image formats using the Qt WebKit rendering engine. wkhtmltopdf can put multiple objects into the output file. An object can be a single web page, a cover page or a directory.
The objects are placed in the output document in the order specified in the command line, and options can be specified on a per-object basis or in the global options area. In this blog post, you will learn to install wkhtmltopdf and wkhtmltoimage on CentOS 8. CentOS 7 Linux machine.
Install wkhtmltopdf and wkhtmltoimage on CentOS 8 | CentOS 7
The binary package of wkhtmltopdf is provided for CentOS 8 and CentOS 7. These packages are available in the software. Download section.
Install wget, we will use it to download the wkhtmltopdf RPM package on CentOS 8. CentOS 7:
sudo yum -y install wget
Install wkhtmltopdf on CentOS 8:
Use wget or curl to download the package.
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos8.x86_64.rpm
Use rpm or yum package management tool to install.
sudo dnf localinstall wkhtmltox-0.12.6-1.centos8.x86_64.rpm
Many dependencies are installed.
Dependencies resolved.
==================================================================================================================================================================
Package Architecture Version Repository Size
==================================================================================================================================================================
Installing:
wkhtmltox x86_64 1:0.12.6-1.centos8 @commandline 15 M
Installing dependencies:
dejavu-fonts-common noarch 2.35-6.el8 BaseOS 74 k
dejavu-sans-fonts noarch 2.35-6.el8 BaseOS 1.5 M
fontconfig x86_64 2.13.1-3.el8 BaseOS 275 k
fontpackages-filesystem noarch 1.44-22.el8 BaseOS 16 k
libX11 x86_64 1.6.8-3.el8 AppStream 611 k
libX11-common noarch 1.6.8-3.el8 AppStream 158 k
libXau x86_64 1.0.8-13.el8 AppStream 36 k
libXext x86_64 1.3.3-9.el8 AppStream 45 k
libXrender x86_64 0.9.10-7.el8 AppStream 33 k
libfontenc x86_64 1.1.3-8.el8 AppStream 37 k
libjpeg-turbo x86_64 1.5.3-10.el8 AppStream 156 k
libpkgconf x86_64 1.4.2-1.el8 BaseOS 35 k
libxcb x86_64 1.13.1-1.el8 AppStream 229 k
pkgconf x86_64 1.4.2-1.el8 BaseOS 38 k
pkgconf-m4 noarch 1.4.2-1.el8 BaseOS 17 k
pkgconf-pkg-config x86_64 1.4.2-1.el8 BaseOS 15 k
ttmkfdir x86_64 3.0.9-54.el8 AppStream 62 k
xorg-x11-font-utils x86_64 1:7.5-40.el8 AppStream 103 k
xorg-x11-fonts-75dpi noarch 7.5-19.el8 AppStream 2.8 M
xorg-x11-fonts-Type1 noarch 7.5-19.el8 AppStream 522 k
Transaction Summary
==================================================================================================================================================================
Install 21 Packages
Total size: 22 M
Total download size: 6.6 M
Installed size: 139 M
Is this ok [y/N]: y
Install wkhtmltopdf on CentOS 7:
Download the RPM package of wkhtmltopdf:
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos7.x86_64.rpm
Then install wkhtmltopdf on CentOS 7 by executing the following command:
sudo yum localinstall wkhtmltox-0.12.6-1.centos7.x86_64.rpm
Confirm the installed software version.
$ wkhtmltopdf --version
wkhtmltopdf 0.12.6 (with patched qt)
$ wkhtmltoimage --version
wkhtmltoimage 0.12.6 (with patched qt)
Convert web page to pdf:
$ wkhtmltopdf <webpage> <destination-pdf-file>
More interesting articles can be found on our website.
Install and configure Virtualmin on CentOS
Install and configure Seafile storage on CentOS
Install wtfutil personal information dashboard for your terminal
Install Bashtop-Terminal Resource Monitor for Linux | macOS | FreeBSD
You can download this article in PDF format via the link below to support us.
Download the guide in PDF format turn off