| 2026-11-24 | v4.2.0 | RELEASE | v4.2.0 is released and available for download |
| Bug fixed | a page header or footer defined in the first block of a page, inside containers with padding, borders or margins (templates of visual editors, which wrap every block in row and column containers), applies from that page again. Since v4.0.23fx2 such a definition was taken for one further down the page and applied from the next page. | ||
| Improvement | v42 rendering engine, identified by converting a large corpus of public websites to PDF, DOCX, RTF and Markdown:
| ||
| Improvement | v42 rendering engine:
| ||
| Improvement | v42 rendering engine performance and memory use:
| ||
| Improvement | v42 DOCX/RTF output follows the PDF layout more closely:
| ||
| Improvement | the v42 rendering engine matches browser layout more closely (page breaks, SVG, CSS, tables, flexbox, DOCX/RTF output):
| ||
| Improvement | v42 applies OpenType GSUB/GPOS features itself: ligatures, small caps, figure styles, kerning, font-feature-settings and the other CSS font-variant properties. Vertical text (writing-mode) as in Chrome: vertical glyph forms and metrics, column wrapping, mixed scripts, text-combine-upright. DOCX/RTF carry both as Word's own OpenType settings and vertical text; DOCX can embed fonts (pd4ml.docx.embed.fonts). | ||
| Bug fixed | A static code analysis of v4.2.0 found no serious issues. The few findings are fixed, and unused code is removed.
| ||
| Improvement | New method PD4ML.addAllowedResourceLocation(String) limits the locations PD4ML loads stylesheets, images, web fonts and attachments from - a security measure for HTML from untrusted sources (local files, internal services). The same restriction as PD4ML_ALLOWED_RESOURCE_LOCATION param, as a method. | ||
| Improvement | A generated pd4fonts.properties lists which characters each font file has, so PD4ML no longer loads font files that cannot display the text when it looks for a fallback font. Font lookup is several times faster with a large font directory. Regenerate existing mapping files with java -jar pd4ml.jar -configure.fonts | ||
| Bug fixed | With built-in PDF fonts, text after a character the font cannot write no longer overlaps the "?" drawn for it (v42 engine). The hyphen (U+2010) and non-breaking hyphen (U+2011) now appear as a regular hyphen instead of "?" in PDF output, and instead of an empty box in v40 image output. | ||
| Improvement | Khmer text wraps (v42 engine): lines break between syllables, as Khmer has no spaces between words. | ||
| Bug fixed | DOCX and RTF output (v40 engine) wrote font sizes up to 1pt too small (cut to a whole point: 12pt text as 11pt), and protectPhysicalUnitDimensions() made physical sizes about four times too small there instead of keeping them true to size. | ||
| Improvement | watermarks (setWatermark(), | ||
| Improvement | with generateForms(true, ...) every form field now carries its own appearance - text, password, textarea, combo and list box values are shown in every viewer, including those that do not regenerate field appearances (print, flattening, PDFBox), and Acrobat no longer asks to save a document that was only read. | ||
| Improvement | The PDF optimizer can write linearized ("Fast Web View") PDF, so a viewer loading the file over a network shows the first page, and then any other page, before the whole file has arrived: pd4optimizecli --linearize or PdfOptimizer.Options.linearize(true). A PDF 1.5+ document is written linearized with object streams and cross-reference streams. Linearized output cannot be combined with output encryption. Bug fixed: the PDF optimizer (and merger, XFDF import) no longer makes PDF 1.5+ files several times larger - objects are written in compressed object streams with a cross-reference stream, as PD4ML writes its own PDFs; the COS parser reads a compressed object from the object stream its cross-reference entry names. Bug fixed: optimizing or linearizing a PDF/A file keeps it compliant - PDF/A-1 keeps classic cross-reference tables (PD4ML writes it with a 1.7 header), and the file identifier (/ID) is no longer dropped. | ||
| Improvement | emoji and color fonts (COLR v0/CPAL vector, CBDT/CBLC bitmap - e.g. Twemoji, Noto Color Emoji, Segoe UI Emoji) are drawn in color in PDF and image output, ZWJ sequences, skin tones and flags as single glyphs, and stay selectable/copyable; an emoji font of the font set is used as fallback automatically; the optional com.pd4ml:pd4ml-emoji add-on (Twemoji; Maven repository and distribution zip) enables emoji with no setup. | ||
| Improvement | CSS gradient backgrounds (linear, radial, conic, repeating; tiled, sized and positioned like images; with transparency) in both layout engines, written to PDF as vector shadings - before, v42 drew a gradient as a black box and v40 ignored it; v42 body/html background images and gradients now also fill every page. In v42 DOCX/RTF output gradients are the word processor's own gradient fills (also on table cells and inline elements), not pictures. | ||
| Improvement | CSS multi-column layout (v42): a multi-column section longer than the rest of its page now continues page by page, filling the columns of each page before it moves on, instead of being cut across all columns by the page break; column-span: all headings run across the full width between two independently balanced column sets; boxes with break-inside: avoid that do not fit a column move to the next one; column rules are drawn on every page. | ||
| Improvement | E-mail messages (.eml) and saved web pages (.mht, .mhtml) can be converted with readEML() and readMHT(), and readHTML() recognizes them automatically. Resources load from https:// only, unless addAllowedResourceLocation() sets another list. The attachments of a message are embedded as PDF attachments. | ||
| Improvement | Smaller and faster-loading PDF output with the same look: small objects are stored compressed in object streams with a compressed cross-reference stream (PDF 1.5 and later; not for PDF/A-1 and encrypted output), pages are organised as a tree of at most 10 entries per node, and page content and dictionaries no longer contain redundant operators or default-value entries. -Dpd4ml.objectStreams=false and -Dpd4ml.optimizeContent=false restore the previous output. | ||
| Improvement | DOM API (com.pd4ml.dom, v42 engine): getDocument() reads and changes the parsed HTML before the output - CSS selectors, attributes, inner HTML, style sheets; layout() reports page count, each element's boxes per page and computed styles without writing the document. | ||
| Improvement | With the v42 engine, DOCX and RTF output is written from the same layout as the PDF - same lines, page breaks and spacing - as editable paragraphs and tables; positioned boxes as text boxes, native SVG (DOCX) and native check boxes. | ||
| Improvement | New layout engine v42 (useHtmlRenderer(LayoutEngine.v42); v40 stays the default): Chrome-verified HTML5/CSS layout with Flexbox, CSS Grid, multi-column, vertical writing modes, @page named pages and margin boxes, richer PDF/UA tagging. Improvement: accessible DOCX and RTF with a PD4ML/UA license (v42 engine): headings as Word heading styles, table header rows, the document language, image alt text and decorative images; without the UA license, Word output carries no alt text, title or accessibility structure. | ||
| 2026-11-01 | v4.1.2 | RELEASE | v4.1.2 is released and available for download |
| 2026-11-01 | v4.0.24 | RELEASE | v4.0.24 is released and available for download |
27 (cached 2026-11-24 15:23)
