Exyr.org Subscribe

WeasyPrint renders HTML+CSS to PDF

Simon Sapin,

WeasyPrint just got its first release! It is a rendering engine for HTML and CSS that produces PDF. I’ve been with Kozea working on it for a few months now.

While it uses many libraries to parse HTML and CSS, draw text or export PDF, it is not based on an existing rendering engine such as WebKit or Gecko. The layout logic is written in Python, is much simpler and thus easier to hack on. In particular, creating WeasyPrint was probably easier than fixing page breaks in Webkit.

This 0.1 release has support for basic CSS2.1 without tables, floats or absolute positioning. However it can already be useful for documents with a “simple” layout.

Grab it, use it, hack it: