Alternatives · WeasyPrint
From wkhtmltopdf to WeasyPrint: what changes
WeasyPrint is an HTML and CSS engine written in Python for pagination, free under BSD-3-Clause, not built on a browser engine. wkhtmltopdf’s status page suggests it, with Prince, for reports from HTML you control. pdfkiln keeps wkhtmltopdf’s command line instead, and renders with Chromium.
What changes when you leave wkhtmltopdf for WeasyPrint
- Another engine. WeasyPrint lays out the page itself: templates tuned for wkhtmltopdf’s WebKit render differently, and are to be checked one by one.
- No JavaScript. Its documentation says so: charts drawn by a script, and headers or footers filled by one, as Frappe’s are, stay empty.
- Headers and footers come from CSS paged media,
@pageand its margin boxes, not from--header-htmlpages. - A Python library and a command line (
weasyprint page.html page.pdf), with Python 3.10 or later and Pango 1.44 or later. knp-snappy, wicked_pdf and the other wkhtmltopdf libraries do not call it. - PDF/A and attachments.
--pdf-variantwrites PDF/A, from PDF/A-1 to PDF/A-4, PDF/UA and PDF/X, and--attachmentembeds files with their relationship: the parts of a Factur-X invoice, with the XML you produce. Factur-X itself is not in its documentation.
When WeasyPrint is the right choice
HTML written for print, without JavaScript, in a Python stack, and PDF/A or PDF/UA at no cost.
When pdfkiln is
Templates made for wkhtmltopdf that must keep their pages, JavaScript in the page or in its headers and footers, libraries that call wkhtmltopdf, any language through the command line. PDF/A-3 and Factur-X from these same templates are what pdfkiln Pro is being built for.
Sources
WeasyPrint on GitHub, its first steps, going further and API reference, and wkhtmltopdf’s status page, read on 29 October 2026.