wkhtmltopdf Errors in Odoo: The Unpatched Qt

Generating PDF reports in Odoo using wkhtmltopdf is a common task — whether it’s printing invoices, quotations, or customer reports. But every now and then, users encounter errors that seem cryptic, especially involving unpatched Qt. Here’s a deep dive into one of the most frequent issues and how to solve it cleanly.

Generating PDF reports in Odoo using wkhtmltopdf is a common task — whether it’s printing invoices, quotations, or customer reports. But every now and then, users encounter errors that seem cryptic, especially involving unpatched Qt. Here’s a deep dive into one of the most frequent issues and how to solve it cleanly.

Unpatched Qt Warnings in wkhtmltopdf

If you’re seeing an error similar to this while trying to generate reports in Odoo:

wkhtmltopdf: b”The switch –header-spacing, is not support using unpatched qt, and will be ignored.
The switch –header-html, is not support using unpatched qt, and will be ignored.
The switch –footer-html, is not support using unpatched qt, and will be ignored”

It means the installed version of wkhtmltopdf does not include the required Qt patches that Odoo depends on for rendering headers, footers, and margins in PDF reports.

Odoo requires a specific patched version of wkhtmltopdf to work correctly with advanced layout features like:

  • Custom headers and footers
  • Page spacing and margins
  • Inline CSS rendering for print styles

The default versions of wkhtmltopdf available through apt install (especially from Ubuntu/Debian repositories) do not include these patches, leading to limitations or ignored directives.

# Remove any existing version

sudo apt remove wkhtmltopdf

# Download the patched version (0.12.4 is stable & supported by Odoo)

cd ~
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz

# Extract the archive

tar xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz

# Move the binary to a system-wide path

sudo mv wkhtmltox/bin/wkhtmlto* /usr/bin/

# Install supporting libraries (if not already present)

sudo apt-get install -y openssl build-essential libssl-dev libxrender-dev \
libx11-dev libxext-dev libfontconfig1-dev libfreetype6-dev fontconfig

wkhtmltopdf -V

Output :

wkhtmltopdf 0.12.4 (with patched qt)

For more insights and professional Odoo Community/Enterprise implementations, connect with us at hashcodeit.com or drop an email at info@hashcodeit.com.  Transform your Odoo journey with precision and expertise!

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4708733859961156"
     crossorigin="anonymous"></script>

Leave a Comment