Skip to content

Wkhtmltopdf

Julien Castiaux edited this page Dec 6, 2023 · 28 revisions

The version of wkhtmltopdf available in Debian/Ubuntu repositories does not support headers and footers (requires patched QT version), so it must be downloaded from the project's page.

Version status

  • 0.12.0[.*]: not recommended, minimal supported version as of Odoo 8.

    • Several known issues fixed in 0.12.1.
  • 0.12.1[.*]: recommended for Odoo 9.0 and earlier (.deb for Debian jessie, .deb for Ubuntu Trusty/Xenial, .deb (0.12.3.1) for Ubuntu Bionic (18.04)).
    Known problems:

    • Some rare crashes during layout of multi-page tables (workaround: play with margins and/or dpi settings: 96, 100, 110dpi). Appears to be fixed in 0.12.2, but this version has worse problems.
    • Known exponential memory usage and file descriptors usage when rendering documents with many pages (500+). Workaround: increase fd limit with ulimit, remove header/footers (internal layout). Experimental horrible patch: split the long table in smaller chunks and use pyPdf to merge the pages.
    • Debian: no official release of 0.12.1 for Debian. We've built one for Jessie here
  • 0.12.2[.*]: not recommended.
    Known problems:

  • 0.12.3: not recommended. Known problems:

    • --dpi parameter still broken, see 0.12.2
  • 0.12.4: not recommended. Was announced to include a fix for the --dpi bug (see 0.12.2) which is better than the zoom workaround, but apparently doesn't work on Linux. Some users report have tried to use option --disable-smart-shrinking but it still does not give the exact same result as 0.12.1.
    Broken on mac OS (fix coming in 0.12.5).

  • 0.12.5-1: recommended for Odoo 10 to 15 or on older systems.

    • --dpi parameter behaves differently than with 0.12.1. It is however possible to obtain the exact same rendering than with 0.12.1, at the same DPI level, by adding --zoom 96/DPI. For example for the default 90 DPI, add --zoom 1.0666.
      This workaround is now enabled by default in Odoo 10 and later

    • The --disable-smart-shrinking option is not necessary and should not be used.

    • Debian: official builds for older Debian ranging from Jessy and up to Buster (see discussion on issue #14127 for older builds).

    • The Odoo 11.0 Docker image is based on stretch and uses wkthmltopdf 0.12.5-1. Binary and libs are extracted in /usr/local/{bin,lib}.

    • Known problems:

      • opacity CSS directive seems broken, can be emulated with RGBA value
  • 0.12.6.1-3: recommended for Odoo 16 and later and on newer systems.

    • --disable-local-file-access parameter is enabled by default.
    • Debian: official builds for Debian and Ubuntu versions starting at Debian 9 Stretch and Ubuntu 16.04 Xenial.
    • The Odoo 16.0 Docker image is based on Ubuntu 22.04 "Jammy" and uses wkhtmltopdf 0.12.6-3.