docx4j 17.2.0 is now available.
To get this release, please see https://www.docx4java.org/downloads.html
Summary of changes; for details please see https://github.com/plutext/docx4j/blob/ ... ANGELOG.md
Markup compatibility:
- Load now keeps mc:AlternateContent wherever Word writes it
- TraversalUtil visits ONE branch of each mc:AlternateContent by default (the Fallback);
org.docx4j.jaxb.McSelection gives the selection rule
Packaging:
- A package docx4j creates is a Word 365 document (compatibilityMode 15 and the five other compat settings Word 365 writes for a new document
- WordprocessingMLPackage.createPackage adds a theme part
Pagination (page layout model):
- New org.docx4j.model.pagination.Paginate: lays the document out with FOP (docx4j-export-fo
on the classpath) and reports which page each paragraph of the main document part starts
on, keyed by w14:paraId (PaginationMap); paginate() also rewrites the document's
w:lastRenderedPageBreak markers at paragraph boundaries
List numbering: refactored and extended
OpenDoPE content control binding:
- Spec working draft published; see https://github.com/plutext/docx4j/tree/ ... 7_1_1/docs
- The XHTML importer's FormattingOption for runs, paragraphs and tables can be set in docx4j.properties
- BindingHandler.setXHTMLImporterCustomizer: a hook invoked on each XHTMLImporterImpl
immediately before convert, for any other importer setting, per content control.
Schema improvements, including the Excel 2010 and 2013 extensions of [MS-XLSX])
HTML export improvements
Markdown export improvements
Fonts:
- New optional jar docx4j-export-fo-fonts-theme2023; use this if you can't install Microsoft's Aptos font download
- IdentityPlusMapper (the default) is the mapper to use everywhere, Windows or not
FontsAnalysis:
- FontsAnalysis.usage(pkg) says what a document uses each font for
- FontsAnalysis.analyse(pkg) reports, per font the document uses and in order of the text it
carries: what it is used for, what docx4j draws it with and why, a grade (EXACT, NEAR, CLASS
or NONE), and what to do about it - which font to install, or which clone and which docx4j font jar or distribution package carries it.
PDF via XSL FO:
- A conversion via XSL FO says what it made of the document's fonts, once: one line per
document font naming what it is drawn in, how close that is and what to do about it - INFO
where the font itself, its embedded form or a metric clone draws it, WARN otherwise with the
action in the line. docx4j.fonts.report.log=summary (the default) | full | off.
- Two FO renderers are supported: Apache FOP 2.11 (the default dependency, unchanged) and
a new docx4j FO renderer, org.docx4j:docx4j-fo-renderer, an upstream-tracking fork of
Apache FOP 2.11 carrying the fixes docx4j found in FOP (not yet released).
FopCapabilities probes which is present, logs one line naming it.
- Layout improvements
Other improvements and fixes, including:
- docx4j now deletes the image files a conversion writes to java.io.tmpdir (where it put
one per picture per run, and never removed it); for HTML and fo output, which point at
those files, they are registered with File.deleteOnExit() instead. Images written to an
imageDirPath you named are untouched. New property
docx4j.convert.out.images.deleteTemporary (default true) opts out.

