Thanks to Novareto who sponsored this feature, WeasyPrint is now able to generate PDF/UA documents 🎉!
PDF/UA is a specific PDF version for accessibility purposes that ensures access to people using assistant technologies like screen readers.
How to Generate PDF/UA Documents?
Previously, we added a new option in WeasyPrint,
--pdf-variant, to let you
choose which PDF variant you want among different PDF/A variant.
To generate PDF/UA documents, you just need to use this option and use the variant
Is the Structure of the Document Important?
To generate a PDF/UA document, the HTML structure of the document is put in the PDF, and so has to be consistent to ensure a nice output when using an assistant technoloy.
Your HTML structure is then very important to have a conforming PDF/UA document. You can try your HTML on a HTML validator, try your PDF on a PDF validator or ask us for some help 😉.
As for the PDF/A generation, PDF/UA support is experimental, so don’t hesitate to open a new issue if you encounter problems with it!
Font Variant Support
Thanks to our OpenCollective backers and sponsors, WeasyPrint now supports variable fonts 🎉!
A variable font allows you to have different typefaces of a font in a single file, rather than one per typeface.
Until now, if you wanted to use, for example, the bold and the italic version of a font,
you needed to define two
@font-face rule in your CSS, one for the bold version
and one for the italic.
But this time is over! With the variable fonts support, if your font
supports bold and italic variants, you just need to define one
@font-face rule. The rendering will be automatically adapted if you set
font-style on your text, or if
you use tags like
You can also use the
attribute to choose non-standard variants proposed by your variable fonts.
Better Support of Footnotes With Multicolumn Layout
With the financial support of Code & Co., we’ve been able to improve the support of footnotes in multicolumn layout 🎊!
When using multicolumn layout, footnotes tended to be rendered on the next page with no reason, or to be in the wrong order (and nobody wants that 😟).
These problems are fixed, among a lot of other small issues that appeared when we worked on this. Footnotes with multicolumn layouts now work much better!
Better List Management on Page Breaks
Thanks to the financial sponsoring of OpenZeppelin, list items management has been improved on page breaks 🎊!
When a list, ordered or unordered, was going over a page break, the position of the marker on the next page was a bit weird and not aligned with the text.
This issue is now fixed, the list marker and the text are nicely aligned when going through a page break. You can use long lists without any problem 😄!
What Are the Next Steps?
The next step is yours! Don’t hesitate to try this beta and report bugs you may find 🐜.
The one after is to fix the reported bugs and release a nice WeasyPrint version 57.
Thanks again to Novareto, Code & Co. and OpenZeppelin for sponsoring these features and fixes. It’s always a pleasure to work with you 😻.
And of course, thanks to our OpenCollective backers and sponsors for sponsoring us and give us time to add new features, fix bugs… in WeasyPrint 💜.
Have fun with this beta!
And by the way, if you didn’t know, we launched a survey about WeasyPrint. It’s opened until October 10th, don’t hesitate to answer!