DEV Community

Cover image for How to Install WKHTMLTOPDF with Patched QT on Ubuntu and CentOS 8
Hafiq Iqmal
Hafiq Iqmal

Posted on

15

How to Install WKHTMLTOPDF with Patched QT on Ubuntu and CentOS 8

Ever needed to convert HTML to PDF and found yourself tangled in a web of outdated software? You’re in the right place. In this guide, I’ll show you how to install wkhtmltopdf with the patched QT on Ubuntu and CentOS 8. Let’s make this painless and straightforward!


Why WKHTMLTOPDF with Patched QT?

First things first, why are we even bothering with this patched QT version? Well, the patched QT version of wkhtmltopdf offers better compatibility and more features compared to the stock version that you usually get from default repositories. If you need reliable PDF generation with advanced CSS and JavaScript support, this is the way to go.

Installing on Ubuntu LTS

Let’s start with Ubuntu. Here’s how you can get wkhtmltopdf up and running.

Step-by-Step Guide:

Update your package list and install xfonts-75dpi package since it is required by wkhtmltopdf:

# sudo apt-get update 
# sudo apt-get install -y wget xfonts-75dpi
Enter fullscreen mode Exit fullscreen mode

Download the wkhtmltopdf package:

# cd ~
# wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb
Enter fullscreen mode Exit fullscreen mode

Install the downloaded package:

# sudo dpkg -i wkhtmltox_0.12.6.1-2.jammy_amd64.deb
Enter fullscreen mode Exit fullscreen mode

Verify the installation:

# wkhtmltopdf --version
Enter fullscreen mode Exit fullscreen mode

If everything went smoothly, you should see the version of WKHTMLTOPDF printed out. Now, you’re all set on Ubuntu!

Installing on CentOS 8

Now, let’s move on to CentOS 8. The steps are a bit different, but just as simple.

Step-by-Step Guide:

Install the WKHTMLTOPDF package directly:

# sudo dnf install -y https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox-0.12.6.1-3.almalinux9.$(uname -m).rpm
Enter fullscreen mode Exit fullscreen mode

Verify the installation:

# wkhtmltopdf --version
Enter fullscreen mode Exit fullscreen mode

That’s it! Your CentOS 8 system should now have wkhtmltopdf installed and ready to go.


Wrapping Up!

There you have it — a quick and easy way to install wkhtmltopdf with the patched QT on both Ubuntu and CentOS 8. Whether you’re converting reports, invoices or any other HTML content to PDF, this setup will have you covered.

Remember, keeping your tools up-to-date and using the right versions can save you a lot of headaches down the line. Happy converting!

If you found this guide helpful, share it with your friends and colleagues. Let’s make the web to PDF conversion process a breeze for everyone!

Additional Tips

Always check for the latest releases on the official WKHTMLTOPDF GitHub page.
For large scale deployments, consider automating the installation process with scripts or configuration management tools.

Thanks for reading! If you have any questions or run into any issues, drop a comment below. Let’s help each other out!

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

AWS Security LIVE!

Hosted by security experts, AWS Security LIVE! showcases AWS Partners tackling real-world security challenges. Join live and get your security questions answered.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️