Documentation page: PD4ML Compared with Other HTML-to-PDF Libraries. This page is also available as Markdown at html-to-pdf-library-comparison.md.

PD4ML Compared with Other HTML-to-PDF Libraries

Choosing a Java HTML to PDF library comes down to four questions: how faithfully it lays out your HTML and CSS, which PDF standards it can produce (PDF/A, PDF/UA, ZUGFeRD), which other formats you need besides PDF, and what the license costs over time. This page compares PD4ML with the libraries teams most often evaluate alongside it: iText with pdfHTML, PDFreactor, Aspose.HTML for Java, BFO Publisher and Report Generator, and the open-source OpenHTMLtoPDF.

The comparison covers PD4ML v4.1.1 and, marked 4.2, features of the upcoming PD4ML 4.2 with its new v42 layout engine. Competitor information comes from their public documentation and price lists as of November 2026; a cell marked "not verified" means we could not confirm it from public sources, not that the feature is missing.

At a glance

  • PD4ML is a pure-Java layout engine with no browser, no native code and no rendering service. One parse writes PDF, DOCX, RTF and images. Licenses are perpetual, one-time fees from €100.
  • iText with pdfHTML converts HTML into iText's layout objects. It is a large PDF toolkit, dual-licensed under AGPL or a commercial subscription quoted per customer.
  • PDFreactor is a commercial HTML-to-PDF server and library with a JavaScript engine and deep CSS Paged Media support, sold as an annual subscription.
  • Aspose.HTML for Java is an HTML processing toolkit with a W3C DOM, scripting and conversion to PDF, XPS, DOCX and images.
  • BFO Publisher is a pure-Java CSS layout engine for HTML and XML; BFO Report Generator is BFO's older XML-based report engine.
  • OpenHTMLtoPDF is a free, LGPL fork of Flying Saucer that renders XHTML and CSS 2.1 to PDF through Apache PDFBox.

PD4ML vs. iText, PDFreactor, Aspose, BFO and OpenHTMLtoPDF: licensing and price

List prices without VAT. iText and BFO's external and OEM licenses are quoted per customer; the figures below are reference points.

Item PD4ML iText + pdfHTML PDFreactor Aspose.HTML Java BFO Publisher / RG OpenHTMLtoPDF
License model Perpetual, one-time fee AGPL or commercial subscription (quote) Annual subscription Perpetual, 1 year of maintenance Perpetual per server (internal), subscription (external) LGPL 2.1, free
Entry price €100 (STD), €220 (UA, accessible PDF) Not published; reported median ≈ $17,600 per year Pro $1,908 per year $979 (1 developer, 1 location) Report Generator $1,617, Publisher $3,430 per server Free
Unlimited deployments Site €1,600–3,200, Enterprise €8,000–16,000 Volume-based quote; reported ≈ $7,300–32,700 per year Premium $4,788, Cluster $15,588 per year Site Small Business $4,895; OEM tiers higher Unlimited license on request (annual) Free
Source code license Supported Site €6,000–8,000, Enterprise €30,000–35,000 Supported Open source (AGPL) Not supported Not supported Escrow only Not supported Supported
Free evaluation All features, watermarked output 30-day trial or AGPL Evaluation license; free personal license Temporary license Fully functional demo Not needed

See PD4ML editions and prices for what each edition (STD, PRO, DMS, UA) includes.

Rendering engine and architecture

Feature PD4ML iText + pdfHTML PDFreactor Aspose.HTML Java BFO Publisher / RG OpenHTMLtoPDF
Rendering engine Own print-focused engines: v40 (default) and v42 (Chrome-verified layout) Own CSS parser feeding iText layout objects Own engine Own engine, "headless browser" model Own CSS layout engine Flying Saucer fork
HTML parser Supported Tolerant HTML5 parser; honours <meta charset> 4.2 Supported jsoup-based Supported HTML5 and XML Supported HTML5 and XHTML Supported HTML5 (repairing) or strict XML; RG: XML only Partial or add-on Well-formed XHTML; HTML5 through a jsoup adapter
XML with XSLT input Supported Not supported Supported Partial or add-on XHTML only Supported XSLT and XInclude Not supported
JavaScript execution Not supported No script engine; PDF document actions only Not supported Supported Canvas, chart libraries, MathJax Supported Not verified Not supported
DOM API before conversion Supported getDocument(): selectors, innerHTML, attributes 4.2 Partial or add-on Tag workers, CSS appliers, convertToElements() Partial or add-on Through JavaScript Supported W3C DOM, XPath, CSS selectors Not supported Partial or add-on Accepts a W3C DOM
Layout read-back Supported layout(): element boxes per page, computed style 4.2 Not supported Not verified Not verified Not supported Not supported
Parse once, write many formats Supported PDF, DOCX, RTF and images from one parse Not supported Not verified Partial or add-on Load once, convert per format Not verified Not supported
Minimum Java Java 8 (TIFF output Java 9) Java 8 Current JRE Separate builds per JDK Current JRE Java 8
Dependencies Single jar plus Bouncy Castle iText Core modules Bundled Large single jar Few third-party libraries PDFBox plus plugin libraries

PD4ML's two-phase model reads and lays out a document once and writes it to several formats. With PD4ML 4.2 the parsed document can be read and changed before conversion.

HTML and CSS layout support

Feature PD4ML iText + pdfHTML PDFreactor Aspose.HTML Java BFO Publisher / RG OpenHTMLtoPDF
Flexbox Supported Supported Including vertical pagination Supported Not verified Supported Not supported
CSS Grid Supported Template areas, line names, dense placement 4.2: 3,609 of 3,758 WebKit grid tests pass Partial or add-on No subgrid or inline-grid Supported Not verified Not verified Not supported
CSS @page Supported Size, :first/:left/:right/:blank, named pages, 16 margin boxes 4.2 Supported Supported Full GCPM Partial or add-on Supported Partial or add-on Page boxes, running elements
Running headers and page numbers Supported HTML headers and footers with $[page] of $[total]; counter(page) in margin boxes 4.2 Supported Running elements, target-counter Supported Partial or add-on Supported Partial or add-on
Different page sizes in one document Supported Page scopes like "2+" or "3-7,odd" Supported Supported Partial or add-on Supported Supported
Multi-column pages Supported Supported Supported Not verified Not verified Not supported
Widow and orphan control Supported Supported Supported Partial or add-on Supported Supported
Media queries Supported Level 4 range syntax, nested @media 4.2 Supported Supported Supported Not verified Partial or add-on
Vertical writing modes Supported 4.2 Not verified Supported Not verified Not verified Not supported
Vector SVG Supported Built-in renderer Supported Supported Supported Supported Supported Batik plugin
MathML Supported Not supported Supported Not verified Supported Supported Plugin
Image maps Supported <area> regions become links 4.2 Not verified Not verified Not verified Not verified Not supported
Canvas, iframe, video Not supported Shown as a labelled box Not supported Supported Canvas Partial or add-on Partial or add-on Not supported
Fit a document onto one page Supported Not supported Not verified Not verified Not verified Not supported

For tag-by-tag details see the PD4ML v42 HTML5 element support matrix and PD4ML's proprietary CSS properties and tags.

Output formats: PDF, DOCX, RTF and images

Feature PD4ML iText + pdfHTML PDFreactor Aspose.HTML Java BFO Publisher / RG OpenHTMLtoPDF
PDF Supported Supported Supported Supported Supported Supported
DOCX (Word) Supported Editable text boxes, native SVG and form controls 4.2 Not supported Not supported Supported Not supported Not supported
RTF Supported Not supported Not supported Not supported Not supported Not supported
Raster images Supported PNG, TIFF, multi-page TIFF Not supported Supported Supported JPG, PNG, BMP, TIFF, GIF Supported Supported
Other formats Not supported Not supported Not supported Supported XPS, Markdown, MHTML Supported Multi-page SVG Not supported

Among the libraries compared, PD4ML is the only one that writes both DOCX and RTF from the same layout as the PDF. See also HTML to raster image conversion.

PDF/A, PDF/UA and e-invoicing standards

Feature PD4ML iText + pdfHTML PDFreactor Aspose.HTML Java BFO Publisher / RG OpenHTMLtoPDF
PDF version control Supported PDF 1.4 to 2.0, ISO 32000-1 extension levels 1–11 Supported Up to 2.0 Supported Not verified Supported Including 2.0 Partial or add-on
PDF/A archiving Supported PDF/A-1a/1b, 2a/2b/2u, 3a/3b/3u, 4, 4e Supported Supported PDF/A-1 to PDF/A-3 Partial or add-on Through Aspose.PDF Supported PDF/A-1 to PDF/A-4 Supported
PDF/UA-1 accessible PDF Supported Headings, lists, tables, links, images; SVG as Figure, MathML as Formula, <th> scope 4.2 Supported Supported Partial or add-on Through Aspose.PDF Supported Supported
PDF/UA-2 on PDF 2.0 Supported Not verified Not verified Not verified Not verified Not supported
PDF/A and PDF/UA combined Supported For example PDF/A-3a with PDF/UA-1 in one call Supported Supported Not verified Supported Not verified
ZUGFeRD and Factur-X Supported Presets, including accessible PDF/A-3a invoices Partial or add-on PDF/A-3 with an attachment, built by hand Not supported ZUGFeRD add-on removed from current versions Not supported Partial or add-on PDF/A-3 attachments Not supported
PDF/X for print Not supported Not verified Supported PDF/X-1a, X-3, X-4 Not supported Supported Not supported
Brotli stream compression (PDF 2.0) Supported Opt-in, 3–31% smaller files 4.2 Not verified Not verified Not verified Not verified Not supported
Conformance check after writing Supported PDF/A status report; strict mode rejects non-conformant source Supported Supported Not verified Supported Partial or add-on

How to produce each standard is described under PDF/A, PDF/UA and e-invoicing formats and ZUGFeRD and Factur-X PDF invoices.

Document features

Feature PD4ML iText + pdfHTML PDFreactor Aspose.HTML Java BFO Publisher / RG OpenHTMLtoPDF
Bookmarks Supported From headings or anchors Supported Supported Not verified Supported Supported
Hyperlinks Supported Internal and external, in PDF and RTF Supported Supported Supported Supported Supported
Table of contents Supported Generated Partial or add-on Through target-counter CSS Supported Through CSS Not supported Supported Through CSS Partial or add-on
Footnotes and endnotes Supported Not verified Supported Not supported Supported Not supported
Watermarks Supported Any HTML, with opacity and rotation, on screen or print only Supported Supported Not verified Supported Partial or add-on
Fillable PDF forms from HTML Supported Inputs, selects, text areas, submit and reset buttons Supported Supported Not supported Supported Partial or add-on
File attachments Supported Supported Supported Not supported Supported Not verified
Metadata Supported Including custom XMP namespaces 4.2 Supported Supported Partial or add-on Supported Partial or add-on
Inject HTML and template data Supported injectHtml(), setDynamicData() Partial or add-on Partial or add-on Through JavaScript Supported DOM Partial or add-on XSLT Partial or add-on

See PDF header and footer generation and preventing widows and orphans.

Fonts and international text

Feature PD4ML iText + pdfHTML PDFreactor Aspose.HTML Java BFO Publisher / RG OpenHTMLtoPDF
TrueType and OpenType embedding with subsetting Supported Fonts indexed ahead of time Supported Supported Supported Supported Including variable fonts Supported
CFF OpenType (.otf) subsetting Supported 4.2 Supported Supported Not verified Supported Not verified
Kerning and ligatures Supported Partial or add-on pdfCalligraph add-on Supported Not verified Supported Partial or add-on
Arabic and Hebrew shaping, bidi Supported Partial or add-on pdfCalligraph add-on Supported Not verified Supported Partial or add-on ICU4J plugin
Indic and South-East Asian scripts Supported Shaped without extra settings 4.2 Partial or add-on pdfCalligraph add-on Supported Not verified Supported Partial or add-on
Chinese, Japanese, Korean Supported Supported Supported Supported Supported Supported

Details: configuring PDF fonts.

Security, signatures and PDF post-processing

Every PD4ML edition, including STD, includes the PDF post-processing toolkit.

Feature PD4ML iText + pdfHTML PDFreactor Aspose.HTML Java BFO Publisher / RG OpenHTMLtoPDF
Encryption and permissions Supported RC4 40/128-bit, AES-128/256 Supported Supported Partial or add-on Through Aspose.PDF Supported Partial or add-on Through PDFBox
Digital signatures Supported PKCS#12, PKCS#11, HSM, cloud KMS, RFC 3161 timestamps, PAdES-LT/LTV Supported Supported Partial or add-on Through Aspose.PDF Supported PKCS#11, cloud HSM Not supported
Merge PDFs Supported Keeps accessibility tags consistent Supported Supported Partial or add-on Through Aspose.PDF Supported Not supported
Optimize file size Supported Partial or add-on pdfOptimizer add-on Not verified Partial or add-on Through Aspose.PDF Not verified Not supported
XFDF import and export Supported ISO 19444-1 Supported Not supported Not supported Not verified Not supported
Low-level PDF object editing Supported COS object model with incremental updates Supported Not supported Not supported Supported Partial or add-on PDFBox

See PD4ML PDF Signing, PDF Merge, PDF Optimizer and PDF COS.

Tools, APIs and integrations

Feature PD4ML iText + pdfHTML PDFreactor Aspose.HTML Java BFO Publisher / RG OpenHTMLtoPDF
Command-line tool Supported Pd4Cmd plus signing, merge, optimize, COS and XFDF tools Not supported Supported Not supported Supported Not supported
Desktop previewer Supported PD4Browser with Fonts Tool Partial or add-on RUPS (PDF inspector) Not supported Not supported Supported Web interface Not supported
Web service and Docker image Not supported Not supported Supported REST and SOAP, official image Partial or add-on Docker sample Supported HTTP and WebSocket, image Not supported
JSP and servlet integration Supported Tag library for javax and Jakarta EE 9+ Not supported Not supported Not supported Partial or add-on Not supported
Languages Java, Python, PHP, .NET, Node.js, Ruby Java, .NET Java, .NET, PHP, Python, Ruby, Perl, Node.js Java Java Java
Custom resource loading Supported Custom URL schemes (database, CMS) Supported Not verified Supported Not verified Supported
IBM Notes/Domino Supported Not supported Not supported Not supported Not supported Not supported

Start with Pd4Cmd, PD4Browser, PD4ML for Python or using PD4ML with Apache Maven.

PD4ML vs. iText pdfHTML

iText is a broad PDF toolkit, and pdfHTML is its HTML add-on: HTML becomes iText layout objects, which suits teams that already build PDFs with iText's API. Commercial use without publishing your own source code requires a commercial license, priced per customer as a subscription. PD4ML is a single engine for HTML and CSS with a perpetual license, writes DOCX and RTF from the same layout, ships PDF/UA-2 and ZUGFeRD presets, and includes signing, merging and optimization in every edition. Complex-script shaping and PDF optimization, which are separate add-ons in iText, are part of PD4ML.

PD4ML vs. PDFreactor

PDFreactor runs JavaScript before layout and implements CSS Paged Media in depth, which helps with chart libraries, Canvas and print-production features such as PDF/X. It is sold as an annual subscription. PD4ML has no script engine and no PDF/X, but costs less than one month of a PDFreactor Pro subscription for a single license, never expires, adds DOCX and RTF output, and offers PDF/UA-2 and e-invoice presets. If your templates do not depend on client-side JavaScript, PD4ML covers the same reports, invoices and catalogues.

PD4ML vs. Aspose.HTML for Java

Aspose.HTML is an HTML processing toolkit: a W3C DOM, scripting and conversion to many formats, with advanced PDF/A and PDF/UA work typically handled by Aspose.PDF. PD4ML is print-focused: deterministic pagination, page headers and footers, footnotes, tables of contents, fillable forms and PDF/UA tagging are built into the engine, and PD4ML 4.2 adds its own DOM API and layout read-back.

PD4ML vs. BFO Publisher and Report Generator

BFO Publisher is architecturally closest to PD4ML: pure Java, its own CSS engine, a command-line tool and a web service, with strong PDF/UA and PDF/X support. It is licensed per server. PD4ML's single, site and enterprise licenses cover unlimited servers at the site and enterprise levels, and PD4ML adds DOCX and RTF output, ZUGFeRD presets and bindings for Python, PHP, .NET, Node.js and Ruby. BFO Report Generator renders its own XML report format rather than general HTML.

PD4ML vs. OpenHTMLtoPDF

OpenHTMLtoPDF is free under the LGPL and a good fit for simple XHTML with CSS 2.1. It has no Flexbox or CSS Grid, no DOCX or RTF output and no digital signatures, and it is maintained by a community fork. PD4ML adds modern CSS layout, office formats, e-invoices, signatures and commercial support, starting at €100.

When PD4ML is not the right choice

  • Your templates need JavaScript to produce their content, for example charts drawn on a <canvas> at load time. PD4ML has no script engine; render such charts as SVG or images on the server instead.
  • You need PDF/X or spot colours for commercial printing.
  • You want a ready-made HTTP conversion service with an official Docker image rather than a library.
  • You need WebP images: PD4ML decodes images through Java ImageIO (JPEG, PNG, GIF, BMP).

Frequently asked questions

What is the best Java library for converting HTML to PDF?

It depends on your templates and standards. For server-side reports, invoices and documents written in HTML and CSS without client-side JavaScript, PD4ML offers modern CSS layout, PDF/A, PDF/UA and ZUGFeRD with a perpetual license. If templates depend on JavaScript, PDFreactor or a headless browser fit better; for a free option with simple XHTML, OpenHTMLtoPDF.

Is PD4ML a good alternative to iText pdfHTML?

Yes, for HTML-to-PDF conversion. PD4ML converts HTML and CSS directly, produces PDF/A, PDF/UA and ZUGFeRD, writes DOCX and RTF, and includes signing and merging, under a one-time license instead of an AGPL or subscription license.

Does PD4ML support CSS Flexbox and CSS Grid?

Yes. Flexbox and CSS Grid are real layout modes in PD4ML. PD4ML 4.2 rewrites the Grid implementation to the CSS Grid specification, including template areas, line names and dense placement.

Can PD4ML create accessible PDF/UA documents?

Yes. The PD4ML UA edition writes tagged PDF/UA-1, and PDF/UA-2 on PDF 2.0, and can combine PDF/UA with the accessible PDF/A levels 1a, 2a and 3a.

Can PD4ML convert HTML to Word (DOCX)?

Yes. The DMS and UA editions convert HTML and CSS to DOCX, and the PRO edition and higher to RTF, from the same layout used for the PDF.

Does PD4ML execute JavaScript?

No. PD4ML lays out HTML and CSS without a script engine, which keeps conversions fast and deterministic. Content produced by scripts, such as charts on a canvas, should be rendered as SVG or images before conversion.

How much does PD4ML cost compared with iText and PDFreactor?

A PD4ML single license starts at €100 and is perpetual. Unlimited site licenses cost €1,600 to €3,200 once. PDFreactor Pro lists at $1,908 per year, and iText commercial licenses are quoted per customer as subscriptions.

Which PD4ML edition do I need for ZUGFeRD or Factur-X invoices?

The DMS edition produces ZUGFeRD and Factur-X invoices on PDF/A-3b. For accessible invoices on PDF/A-3a, use the UA edition.

Try PD4ML

Every PD4ML edition can be evaluated with all features enabled; unlicensed output carries a watermark. Download PD4ML, follow the Programmer's Manual and the usage examples, and compare the result with your current library on your own templates. When you are ready, choose a license.

Product names are trademarks of their respective owners. Competitor capabilities and prices are taken from public sources as of November 2026 and may have changed; corrections are welcome through PD4ML support.