Latest version of WeasyPrint is v0.42.3, released on March 27, 2018 (changelog).

WeasyPrint 0.42.3

WeasyPrint 0.42.3 has been released.

Versions 0.42.x will only get simple bug fixes backported from the master branch. New features, optimizations and complex bug fixes will only be added to the 43+ versions that don’t support Python 2 anymore.

Do not rely on future versions, development on the 0.x branch may be stopped at any moment.

Bug fixes:

  • #583: Fix floating-point number error to fix floating box layout
  • #586: Don’t optimize resume_at when splitting lines with trailing spaces
  • #582: Fix table layout with no overflow
  • #580: Fix inline box breaking function
  • #576: Split replaced_min_content_width and replaced_max_content_width
  • #574: Respect text direction and don’t translate rtl columns twice
  • #569: Get only first line’s width of inline children to get linebox width

WeasyPrint 0.42.2

WeasyPrint 0.42.2 has been released.

Versions 0.42.x will only get simple bug fixes backported from the master branch. New features, optimizations and complex bug fixes will only be added to the 43+ versions that don’t support Python 2 anymore.

Do not rely on future versions, development on the 0.x branch may be stopped at any moment.

Bug fixes:

  • #560: Fix a couple of crashes and endless loops when breaking lines.

WeasyPrint 0.42.1

WeasyPrint 0.42.1 has been released.

Versions 0.42.x will only get simple bug fixes backported from the master branch. New features, optimizations and complex bug fixes will only be added to the 43+ versions that don’t support Python 2 anymore.

Do not rely on future versions, development on the 0.x branch may be stopped at any moment.

Bug fixes:

  • #566: Don’t crash when using @font-config.
  • #567: Fix text-indent with text-align: justify.
  • #465: Fix string(*, start).
  • #562: Handle named pages with pseudo-class.
  • #507: Fix running headers.
  • #557: Avoid infinite loops in inline_line_width.
  • #555: Fix margins, borders and padding in column layouts.

WeasyPrint 0.42

WeasyPrint 0.42 has been released.

WeasyPrint is not tested with (end-of-life) Python 3.3 anymore.

This release is probably the last version of the 0.x series.

Next version may include big changes:

  • end of Python 2.7 support,
  • initial support of bidirectional text,
  • initial support of flexbox,
  • improvements for speed and memory usage.

New features:

  • #532: Support relative file URIs when using CLI.

Bug fixes:

  • #553: Fix slow performance for pre-formatted boxes with a lot of children.
  • #409: Don’t crash when rendering some tables.
  • #39: Fix rendering of floats in inlines.
  • #301: Split lines carefully.
  • #530: Fix root when frozen with Pyinstaller.
  • #534: Handle SVGs containing images embedded as data URIs.
  • #360: Fix border-radius rendering problem with some PDF readers.
  • #525: Fix pipenv support.
  • #227: Smartly handle replaced boxes with percentage width in auto-width parents.
  • #520: Don’t ignore CSS @page rules that are imported by an @import rule.

WeasyPrint 0.41

WeasyPrint 0.41 has been released.

WeasyPrint now depends on pdfrw >= 0.4.

New features:

  • #471: Support page marks and bleed.

Bug fixes:

  • #513: Don’t crash on unsupported image-resolution values.
  • #506: Fix @font-face use with write_* methods.
  • #500: Improve readability of _select_source function.
  • #498: Use CSS prefixes as recommended by the CSSWG.
  • #441: Fix rendering problems and crashes when using @font-face.
  • bb3a4db: Try to break pages after a block before trying to break inside it.
  • 1d1654c: Fix and test corner cases about named pages.


  • #508: Add missing libpangocairo dependency for Debian and Ubuntu.
  • a7b17fb: Add documentation on logged rendering steps.

WeasyPrint 0.40

WeasyPrint 0.40 has been released.

WeasyPrint now depends on cssselect2 instead of cssselect and lxml.

New features:

  • #57: Named pages.
  • Unprefix properties, see #498.
  • Add a “verbose” option logging the document generation steps.

Bug fixes:

  • #483: Fix slow performance with long pre-formatted texts.
  • #70: Improve speed and memory usage for long documents.
  • #487: Don’t crash on local() fonts with a space and no quotes.

WeasyPrint 0.39

WeasyPrint 0.39 has been released.

Bug fixes:

  • Fix the use of WeasyPrint’s URL fetcher with CairoSVG.

WeasyPrint 0.38

WeasyPrint 0.38 has been released.

Bug fixes:

  • #477: Don’t crash on font-face’s src attributes with local functions.

WeasyPrint 0.37

WeasyPrint 0.37 has been released.

WeasyPrint now depends on tinycss2 instead of tinycss.

New features:

  • 437: Support local links in generated PDFs.

Bug fixes:

  • 412: Use a NullHandler log handler when WeasyPrint is used as a library.
  • 417, 472: Don’t crash on some line breaks.
  • 327: Don’t crash with replaced elements with height set in percentages.
  • 467: Remove incorrect line breaks.
  • 446: Let the logging module do the string interpolation.

WeasyPrint 0.36

WeasyPrint 0.34, 0.35 and 0.36 have been released.

New features:

  • #407: Handle ::first-letter.
  • #423: Warn user about broken cairo versions.

Bug fixes:

  • #411: Typos fixed in command-line help.
  • #410: Fix AssertionError in split_text_box.
  • #398: Honor the presentational_hints option for PDFs.
  • #399: Avoid CairoSVG-2.0.0rc* on Python 2.
  • #396: Correctly close files open by mkstemp.
  • #403: Cast the number of columns into int.
  • Fix multi-page multi-columns and add related tests.

WeasyPrint 0.33

WeasyPrint 0.33 has been released.

New features:

  • #393: Add tests on MacOS.
  • #370: Enable @font-face on MacOS.

Bug fixes:

  • #389: Always update resume_at when splitting lines.
  • #394: Don’t build universal wheels.
  • #388: Fix logic when finishing block formatting context.

WeasyPrint 0.32

WeasyPrint 0.32 has been released.

New features:

  • #28: Support @font-face on Linux.
  • Support CSS fonts level 3 almost entirely, including OpenType features.
  • #253: Support presentational hints (optional).
  • Support break-after, break-before and break-inside for pages and columns.
  • #384: Major performance boost.

Bux fixes:

  • #368: Respect white-space for shrink-to-fit.
  • #382: Fix the preferred width for column groups.
  • Handle relative boxes in column-layout boxes.


  • Add more and more documentation about Windows installation.
  • #355: Add fonts requirements for tests.

WeasyPrint 0.31

WeasyPrint 0.31 has been released.

New features:

  • #124: Add MIME sniffing for images.
  • #60: CSS Multi-column Layout.
  • #197: Add hyphens at line breaks activated by a soft hyphen.

Bux fixes:

  • #132: Fix Python 3 compatibility on Windows.


  • #329: Add documentation about installation on Windows.

WeasyPrint 0.30

WeasyPrint 0.30 has been released.

WeasyPrint now depends on html5lib-0.999999999.

Bux fixes:

  • Fix Acid2
  • #325: Cutting lines is broken in page margin boxes.
  • #334: Newest html5lib 0.999999999 breaks rendering.

WeasyPrint 0.29

WeasyPrint 0.29 has been released.

Bug fixes:

  • #263: Don’t crash with floats with percents in positions.
  • #323: Fix CairoSVG 2.0 pre-release dependency in Python 2.x.

WeasyPrint 0.28

WeasyPrint 0.28 has been released.

Bug fixes:

  • #189: white-space: nowrap still wraps on hyphens
  • #305: Fix crashes on some tables
  • Don’t crash when transform matrix isn’t invertible
  • Don’t crash when rendering ratio-only SVG images
  • Fix margins and borders on some tables

WeasyPrint 0.27

WeasyPrint 0.27 has been released.

New features:

  • #295: Support the ‘rem’ unit.
  • #299: Enhance the support of SVG images.

Bug fixes:

  • #307: Fix the layout of cells larger than their tables.


  • The website is now on GitHub Pages, the documentation is on Read the Docs.
  • #297: Rewrite the CSS chapter of the documentation.

WeasyPrint 0.26

WeasyPrint 0.26 has been released.

New features:

  • Support the empty-cells attribute.
  • Respect table, column and cell widths.

Bug fixes:

  • #172: Unable to set table column width on tables td’s.
  • #151: Table background colour bleeds beyond table cell boundaries.
  • #260: TypeError: unsupported operand type(s) for +: ‘float’ and ‘str’.
  • #288: Unwanted line-breaks in bold text.
  • #286: AttributeError: ‘Namespace’ object has no attribute ‘attachments’.

WeasyPrint 0.20: Border radius

WeasyPrint 0.20 has been released with new features and bug fixes.

  • Add support for border-radius.
  • Feature #77: Add PDF metadata from HTML.
  • Feature #12: Use html5lib.
  • Tables: handle percentages for column groups, columns and cells, and values for row height.
  • Bug fixes:
    • Fix #84: don’t crash when stylesheets are not available.
    • Fix #101: use page ids instead of page numbers in PDF bookmarks.
    • Use logger.warning instead of deprecated logger.warn.
    • Add font-stretch in the font shorthand.

WeasyPrint 0.16: PDF zoom and bug fixes

A small release this time.

A new zoom parameter on PDF output can change the ratio between CSS length units and PDF units. The various CSS units however still have the same relative ratios: a CSS pixel is always one 96th of an inch. This can be a work-around for using an existing fixed-width CSS layout on various page sizes.

A few bugs in WeasyPrint were fixed and some in pycairo were worked around. This restores compatibility with Debian Squeeze and other distributions that still use broken versions of pycairo.

Changelog for 0.16.

WeasyPrint 0.15: More API, more docs, more fixes

0.15 is (finally!) out. This one is light in CSS features, but Sphinx-based documentation as well as a new API with low-level access to individual pages.

Backward-incompatible change: the HTML.get_png_pages() method is gone, it was ridiculously specific compared to the new API. It can be reproduced like this:

def get_png_pages(document):
    """Yield (png_bytes, width, height) tuples."""
    for page in document.pages:
        yield document.copy([page]).write_png()

Changelog for 0.15.

WeasyPrint 0.13: PyGTK compatibility

0.13 will fall back on PyGTK if PyGObject 3 is not available. This enables WeasyPrint to run and pass its tests on Debian Squeeze (the current stable, as of this writing.)

Hopefully this will make WeasyPrint easier to install on more platforms such as OS X. Testers wanted!

WeasyPrint 0.12: border-collapse and Flask-WeasyPrint

WeasyPrint 0.12 is out.

This release adds support for the collapsing border model of tables, through the border-collapse property. Previously, table borders were always separated. This new model is incompatible with table headers and footers: with border-collapse: collapse, <thead> and <tfoot> elements are treated like normal <tbody> groups and are not repeated on each page.

On an unrelated note, 0.12 also adds the URL fetcher hook to the public API. It allows to control or override how WeasyPrint accesses HTTP or other URLs for HTML documents, CSS stylesheets, and images.

Flask-WeasyPrint is a new extension that makes use of an URL fetcher to integrate WeasyPrint in a Flask application.

WeasyPrint 0.11: floats, Acid2 and unprefixing

WeasyPrint 0.11 is out.

It has not been long since 0.10, but the point of this release is to finally merge the support for floats and clear that we have had for a while in an experimental branch.

With this (and countless other bug fixes), WeasyPrint now passes the Acid2 test! See the details or try it yourself:

weasyprint acid2.pdf
weasyprint acid2.png

And now for something completely different, the image-rendering, transform, transform-origin and size properties are unprefixed. The prefixed form (eg. -weasy-size) is ignored but gives a specific warning.

You will need to change your stylesheets if you used any of these with a prefix.

As usual, the details of less visible changes are in the changelog.

WeasyPrint 0.8, tinycss and cssselect

Some new features as usual. The big one is automatic layout for tables. Roughly, columns will get their width determined by the amount of content.

Other important but more underlying changes are tinycss and cssselect. tinycss is a new CSS parser I wrote from scratch as a smaller and faster alternative to cssutils. You can read more about it on my blog. As to cssselect, I took over its maintenance after extracting it from lxml. It now supports most Level 3 selectors and can be extended more easily.

WeasyPrint 0.4 to 0.7; BSD license

I’ve been neglecting this “news” section for a while, and a lot has happened since then.

Versions 0.4 to 0.7 of WeasyPrint have brought many new features. The big ones are Python 3 support, page headers and footers with page counters, justified text, 2D transforms, and better page break control. The list of missing CSS 2.1 features is shrinking visibly.

Features aside, and perhaps more importantly, the project is now BSD-licensed starting from 0.7.1. (I did not bother to re-release the previous version with the new license, but just ask if you need them.) This less restrictive license will hopefully bring more users.

By the way, the project’s mailing-list is now up and running.

WeasyPrint 0.3: SVG images and generated content

New WeasyPrint release. The big features in 0.3 are SVG images and generated content with the :before and :after pseudo-elements. As usual, everything is in the changelog.

To use the latest and greatest WeasyPrint, you’ll need to upgrade cssutils to 0.9.8 and install CairoSVG.

Tables in WeasyPrint!

I just released WeasyPrint 0.2, now with tables!

This new version also has other minor new features and bug fixes. See the changelog for details.

WeasyPrint 0.1 is released

WeasyPrint finally got its first release! It’s a rendering engine for HTML and CSS that produces PDF.

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: