October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Linux Installation

How to Install wkhtmltopdf with Patched Qt on Ubuntu 16.04

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install the upstream wkhtmltopdf 0.12.6 Xenial package that matches your Ubuntu 16.04 architecture, not Ubuntu’s default repository build. The upstream package includes patched Qt; after installation, wkhtmltopdf --version should contain with patched qt. If package configuration stops on fonts, install xfonts-75dpi and xfonts-base, then repair dependencies with sudo apt-get -f install.

What you will install

Ubuntu 16.04 is codenamed Xenial. The wkhtmltopdf project’s stable 0.12.6 release matrix lists Xenial packages for amd64, i386 and arm64. Download the file whose architecture matches the output of dpkg --print-architecture. The filename follows this pattern:

wkhtmltox_0.12.6-1.xenial_<arch>.deb

For example, a 64-bit Intel or AMD host uses wkhtmltox_0.12.6-1.xenial_amd64.deb.

Why the patched-Qt package matters

wkhtmltopdf is built on Qt WebKit. Several project features are not available in an ordinary upstream Qt build. The Ubuntu manpage explicitly describes its repository build as “not using wkhtmltopdf patched qt,” so installing Ubuntu’s wkhtmltopdf package can produce a working command that nevertheless lacks patched-only behavior such as headers and footers.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Installation source Qt variant When to use it
Ubuntu repository package Unpatched Qt Only when you do not need features that require patched Qt.
Official wkhtmltopdf Xenial 0.12.6 package Patched Qt Use this for headers, footers and other patched-Qt functionality.

The package choice is therefore a functional requirement, not merely a version preference.

Check prerequisites and architecture

1. Confirm the CPU architecture

Run:

dpkg --print-architecture

Record the result exactly. The supported Xenial labels in the release matrix are amd64, i386 and arm64. Do not install an amd64 package on an i386 or arm64 system.

2. Refresh package metadata

sudo apt-get update

You need access to Ubuntu repositories for runtime libraries and fonts. The downloaded Debian file is not a completely self-contained operating system; the project notes that system libraries are still required even for static builds.

3. Install common font dependencies

Install the two font packages that have been reported as unmet dependencies during Debian package configuration:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo apt-get install xfonts-75dpi xfonts-base

Installing them before the wkhtmltopdf package avoids the most common configuration failure. If your system reports additional missing packages, let APT resolve them rather than forcing the package installation.

Download the official Xenial 0.12.6 package

Open the official wkhtmltopdf downloads page and select the stable 0.12.6 build for Ubuntu 16.04 Xenial and the architecture you recorded. Save the .deb file in a directory you can reference from the shell, such as ~/Downloads. Verify the filename before installing; it should include both 0.12.6-1.xenial and your architecture.

The upstream package is preferable here because the distribution build omits patched Qt. Package compatibility still depends on the architecture and the exact Xenial system libraries available on the machine.

Install wkhtmltopdf

Method A: install the local package with APT

Recent APT versions can install a local Debian file and resolve repository dependencies in one operation. Change to the directory containing the download, then substitute the real architecture in the filename:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
cd ~/Downloads
sudo apt install ./wkhtmltox_0.12.6-1.xenial_amd64.deb

For an i386 or arm64 host, replace amd64 accordingly. The leading ./ is important: it tells APT that this is a local file rather than a package name to search for in repositories.

Method B: use dpkg, then repair dependencies

If your APT version does not support local-file installation, or if you prefer the traditional two-step process, run:

cd ~/Downloads
sudo dpkg -i ./wkhtmltox_0.12.6-1.xenial_amd64.deb
sudo apt-get -f install

dpkg -i unpacks and registers the package but does not fetch missing dependencies. When it leaves the package unconfigured, sudo apt-get -f install asks APT to install or correct the dependencies. Review the proposed changes, allow the repair, and then perform the version check below.

Verify that patched Qt is installed

Run:

wkhtmltopdf --version

A successful installation reports version 0.12.6 and includes the text with patched qt. If the command is not found, the package did not install its executable into the current PATH. If the version appears but the phrase is absent, you likely installed Ubuntu’s unpatched build or selected the wrong package.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Run a smoke conversion

Convert a simple public page:

wkhtmltopdf https://example.com example.pdf

Check that example.pdf exists and opens. This verifies that the executable can start a WebKit render, fetch a URL and write a PDF; it is separate from the version check and helps expose runtime library or network problems.

Headless operation

wkhtmltopdf and wkhtmltoimage are headless command-line tools that use Qt WebKit to render HTML to PDF or image formats. A graphical desktop session or display service is not required for normal command-line operation. This makes the Xenial package suitable for servers and scheduled jobs, provided the required libraries and fonts are installed.

Troubleshooting installation failures

Symptom Likely cause Fix
package architecture ... does not match system The downloaded file targets a different CPU architecture. Run dpkg --print-architecture and download the matching Xenial file.
Unmet dependencies mention xfonts-75dpi or xfonts-base The font packages are not installed. Run sudo apt-get install xfonts-75dpi xfonts-base, then rerun sudo apt-get -f install.
dpkg reports that the package is left unconfigured One or more dependencies are missing. Run sudo apt-get -f install, review the proposed dependency changes, and check wkhtmltopdf --version again.
Version output lacks with patched qt An Ubuntu repository build or another unpatched binary is being executed. Remove or supersede that build, install the upstream Xenial 0.12.6 package, and verify the executable found by your PATH.
APT cannot find the local file The command was run from a different directory or omitted ./. cd to the download directory and use sudo apt install ./filename.deb.
The package cannot be installed directly Your packaging tools or dependency state prevents normal installation. The official FAQ describes extracting the package as a fallback, but extraction does not remove the requirement for its runtime dependencies. Install those dependencies first and use the extracted binaries only as a controlled workaround.
The smoke conversion fails or produces no usable PDF The page may fail to load, required libraries may be absent, or the input may depend on resources unavailable to the renderer. First confirm the version string, repair dependencies, test with https://example.com, and then investigate the target page separately.

Security requirements for server-side conversion

Treat every HTML document, stylesheet, script and referenced resource as untrusted input when wkhtmltopdf runs on a server. The project’s downloads guidance warns: “Do not use wkhtmltopdf with any untrusted HTML – be sure to sanitize any user-supplied HTML/JS, otherwise it can lead to complete takeover of the server it is running on!”

  • Sanitize user-supplied HTML, CSS and JavaScript before passing it to the converter.
  • Do not allow arbitrary users to choose unrestricted URLs or local file paths.
  • Run conversion with the least filesystem and network privileges practical.
  • Keep conversion isolated from credentials and other sensitive host resources.

These precautions apply even though the utility is headless; headless describes the user interface, not the trust level of the content it renders.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Operational checklist

  1. Confirm Ubuntu 16.04 (Xenial) and run dpkg --print-architecture.
  2. Download the official 0.12.6 Xenial .deb for amd64, i386 or arm64.
  3. Install xfonts-75dpi and xfonts-base.
  4. Install the local package with APT, or use dpkg -i followed by apt-get -f install.
  5. Confirm wkhtmltopdf --version includes with patched qt.
  6. Run a simple conversion and inspect the resulting PDF.
  7. Sanitize and isolate all untrusted conversion input.

Or skip the browser setup

If your actual goal is a clean website screenshot or PDF rather than maintaining a Xenial wkhtmltopdf installation, ScreenshotNeo provides a website screenshot API and MCP server. One GET request captures a URL; consent banners are accepted and removed along with more than 60 known consent platforms, newsletter popups and chat widgets before capture. Bot checks, blank pages, timeouts, failed loads and cache hits are not billed, and each response identifies the result with X-Page-Verdict and X-Billed headers.

See the ScreenshotNeo API documentation for all parameters. The basic cURL request is:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Python

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo also supports full-page captures with lazy images loaded, CSS-selector element shots, dark mode, 12 device presets plus custom viewports, retina scale, PDF paper and page controls, custom CSS and JavaScript, click and wait actions, request and resource blocking, custom headers, cookies, user agents, authorization, timezone and geolocation, transparent backgrounds, resizing, configurable caching, signed links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API and an OpenAPI specification. Its MCP server exposes take_screenshot, get_page_info and capture_pdf to Claude, Cursor and other MCP clients.

The Free plan includes 1,000 screenshots each month with no card. Paid plans start at $5 for 3,000 shots; Growth is $15 for 15,000, Pro $39 for 60,000, Scale $99 for 250,000 and Business $249 for 1,000,000. Yearly billing gives two months free, and every feature is included on every plan. Create a free ScreenshotNeo account to try it without a card.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Does extracting the Xenial package eliminate its dependencies?

No. Extraction can be a fallback when direct installation is impossible, but the required system libraries and fonts must still be present.

What does the architecture value control in the download filename?

It selects the binary package built for your CPU and Ubuntu userspace; use the exact value printed by dpkg --print-architecture.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

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

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Read next

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.