Migration guides · ERP

Replace wkhtmltopdf with pdfkiln in Odoo

Odoo prints its reports, invoices, quotations and delivery slips, with the wkhtmltopdf it finds in the PATH. The Debian package puts pdfkiln’s there and replaces the official wkhtmltox package: there is nothing to configure in Odoo.

1. Install pdfkiln

On Debian and Ubuntu (amd64 and arm64), from the signed APT repository, which brings Chromium’s security fixes with apt upgrade. It installs /usr/bin/wkhtmltopdf and replaces the official wkhtmltox package.

curl -fsS https://apt.pdfkiln.org/pdfkiln-archive-keyring.asc | sudo tee /usr/share/keyrings/pdfkiln-archive-keyring.asc > /dev/null
printf 'Types: deb\nURIs: https://apt.pdfkiln.org\nSuites: stable\nComponents: main\nSigned-By: /usr/share/keyrings/pdfkiln-archive-keyring.asc\n' \
  | sudo tee /etc/apt/sources.list.d/pdfkiln.sources
sudo apt update && sudo apt install pdfkiln

Elsewhere: the Docker image, the archives and the Windows installer.

2. Point Odoo at it

Restart Odoo: it reads the program’s version when it starts. Then print a report.

3. Check

wkhtmltopdf --version
# wkhtmltopdf 0.12.6 (with patched qt), pdfkiln <version>, Chromium <version>

The answer starts as wkhtmltopdf 0.12.6’s does: libraries that read the version keep working.

What Odoo expects, and what pdfkiln does

Tested

The Odoo 17 reports of the 32-template corpus keep their page count against wkhtmltopdf 0.12.6, and 99.1 % of the corpus’s words stay on the same page (Linux).

Something renders differently? Open an issue with the HTML and both PDFs: github.com/Jamalofski/pdfkiln/issues. The known differences are listed in the README.