pdfHTML is an iText Core add-on for creating PDF from HTML/XML (and associated CSS).
This release brings major flexbox improvements, accessibility upgrades, and a host of bug fixes. Here’s what’s new and improved!
Major Flexbox Improvements
We’ve modernized and expanded our flexbox support, making it easier to create complex, responsive layouts for your PDFs. The improvements are based on a thorough review of our flexbox capabilities and customer requests, and include adding support for more complex justify-content values, allowing for advanced alignment options in flex layouts. We also implemented the align-self property, so individual flex items can now override container alignment for more granular control.
General handling of CSS tokens with escaped code points has been improved, so CSS parsing is now more standards-compliant and robust.
You can find an updated list of HTML/CSS features currently supported by pdfHTML on the iText Knowledge Base.
Accessibility & Standards Compliance
Support for aria-label and <label> as alternative descriptions for <textarea> has been added, bringing accessibility parity with <input\ elements and improving PDF/UA compliance when using pdfHTML.
Bug Fixes
We enabled collapsing margins for flex-items’ children, ensuring margin behavior matches browser expectations. Basic support for the CSS order property has been added, letting you rearrange flex items visually without changing the HTML structure. We also investigated and improved support for area breaks inside flex containers, making sure page breaks behave logically in complex layouts.
A couple of flex-related bugs which resulted in NPEs were also resolved. One when a table inside a double flex container had a missing column width, and the other when using display: flex on headers.
New Features
- DEVSIX-5163: Support more complex justify-content values
- DEVSIX-5166: flex: Support align-self property
- DEVSIX-9402: Flex: basic support of CSS order property for flex items
Improvements
- DEVSIX-5196: Support collapsing margins for flex-items' children
- DEVSIX-9418: Support AreaBreak inside a flex container
- DEVSIX-9252: Support aria-label and <label> as alternative descriptions for <textarea> in pdfHTML
Bug Fixes
- DEVSIX-8005: NPE for column width in layout when table inside double flex
- DEVSIX-9266: NPE flex on header: Cannot read field "maxPositiveMargin" because "marginsCollapse" is null
- DEVSIX-9139: none CSS property is not rendered in PDF output
- DEVSIX-5212: CSS parsing: implement correct handling of css tokens with escaped code point