How to install wkhtmltopdf on centos 8

How To Install wkhtmltopdf and wkhtmltoimage On CentOS 8

On this article, we will discuss how to install wkhtmltopdf and wkhtmltoimage version On Linux CentOS 8 operating system.


wkhtmltopdf and wkhtmltoimage is an open source (LGPLv3) and much effective command-line shell utility that enables user to convert any given HTML (Web Page) to PDF document or an image (jpg, png, etc). On this article we will discuss how to install

wkhtmltopdfn and whtmltoimage installation

The last stable of wkhtmltopdf and whktmltoimage is version 0.12.6, which was released on June 11, 2020. We will use its distribution for our tutorial purpose. The installation process will be consist of several simple steps as described below :

  1. Download binnary files from official wkhtmlmtopdf github
  2. Install source and verify its version
  3. Test the software tools

Download wkhtmltopdf binnary files

The first step on this tutorial is to download the wkhtmltopdf sourc file from official wkhtmlmtopdf github, by using wget command line : wget

[ramans@localhost ~]$ wget
 --2020-12-29 18:14:04--
 Resolving (…
 Connecting to (||:443… connected.
 HTTP request sent, awaiting response… 302 Found
 Location: [following]
 --2020-12-29 18:14:06--
 Resolving (…
 Connecting to (||:443… connected.
 HTTP request sent, awaiting response… 200 OK
 Length: 16237416 (15M) [application/octet-stream]
 Saving to: ‘wkhtmltox-0.12.6-1.centos8.x86_64.rpm’
 wkhtmltox-0.12.6-1.centos8. 100%[=========================================>]  15.48M   231KB/s    in 2m 52s  
 2020-12-29 18:17:01 (92.3 KB/s) - ‘wkhtmltox-0.12.6-1.centos8.x86_64.rpm’ saved [16237416/16237416]
download wkhtmltopdf
Download wkhtmltopdf

The wkhtmltox-0.12.6-1.centos8.x86_64.rpm file has been downloaded to our home directory.

Install wkhtmltopdf source and verify its version

The next step is to install the source file by using command line : sudo dnf localinstall wkhtmltox-0.12.6-1.centos7.x86_64.rpm.

[ramans@localhost ~]$ sudo dnf localinstall wkhtmltox-0.12.6-1.centos7.x86_64.rpm
 [sudo] password for ramans: 
 Last metadata expiration check: 0:10:16 ago on Tue 29 Dec 2020 06:16:56 PM PST.
 Dependencies resolved.
  Package                Architecture        Version                           Repository                 Size
  wkhtmltox              x86_64              1:0.12.6-1.centos7                @commandline               13 M
 Transaction Summary
 Downgrade  1 Package
 Total size: 13 M
 Is this ok [y/N]: y
 Downloading Packages:
 Running transaction check
 Transaction check succeeded.
 Running transaction test
 Transaction test succeeded.
 Running transaction
   Preparing        :                                                                                      1/1 
   Downgrading      : wkhtmltox-1:0.12.6-1.centos7.x86_64                                                  1/2 
   Cleanup          : wkhtmltox-1:0.12.6-1.centos8.x86_64                                                  2/2 
   Running scriptlet: wkhtmltox-1:0.12.6-1.centos8.x86_64                                                  2/2 
   Verifying        : wkhtmltox-1:0.12.6-1.centos7.x86_64                                                  1/2 
   Verifying        : wkhtmltox-1:0.12.6-1.centos8.x86_64                                                  2/2 
 Installed products updated.
install wkhtmltox on centos 8
installation of wkhtmltox on Centos 8

The wkhtmltox, where wkhtmltopdf and wkhtmltoimage exist has been competed done, the next step is to verify its verstion by querying it using command line : wkhtmltopdf -- version and wkhtmltoimage --version.

[ramans@localhost ~]$ wkhtmltopdf --version
 wkhtmltopdf 0.12.6 (with patched qt)
[ramans@localhost ~]$ wkhtmltoimage --version
 wkhtmltoimage 0.12.6 (with patched qt)
whktmltopdf and wkhtmltoimage version
whktmltopdf and wkhtmltoimage version

Test Using wkhtmltopdf and wkhtmltoimage

On this secation we will take a testing to generate an pdf and image file uwing wkhtmltopdf and wkhtmltoimage tools.

  • working directory : /home/ramans
  • web site to be printed :
  • pdf file to be produced : install_apache_active_MQ_on_CentOS8.pdf
  • image file to be produced : install_apache_active_MQ_on_CentOS8.jpeg
[ramans@localhost ~]$ wkhtmltopdf install_apache_active_MQ_on_CentOS8.pdf
 Loading pages (1/6)
 Counting pages (2/6)                                               
 Resolving links (4/6)                                                       
 Loading headers and footers (5/6)                                           
 Printing pages (6/6)
[ramans@localhost ~]$ wkhtmltoimage install_oracle_developer_on_ubuntu.jpeg
 Loading page (1/2)
 Rendering (2/2)                                                    

The file was created are :

[ramans@localhost ~]$ ls -ltr active_MQ
 -rw-rw-r--. 1 ramans ramans  753525 Dec 31 16:22 install_apache_active_MQ_on_CentOS8.pdf
 -rw-rw-r--. 1 ramans ramans 1852639 Dec 31 16:26 install_apache_active_MQ_on_CentOS8.jpeg
pdf and jpege files prouced by wkhtmltopdf and wkhtmltoiage
pdf and jpeg files prouced by wkhtmltopdf and wkhtmltoiage
wkhtmltopdf, pdf file


The wkhtmltopdf and wkhtmltoimage are useful tools for producing pdf and image file. On this article, we have through the installation it properly. I hope it will be useful for you. Stay at home, stay safe and happy weekend.

Share this article via :

One thought on “How To Install wkhtmltopdf and wkhtmltoimage On CentOS 8

Leave a Reply

Your email address will not be published. Required fields are marked *