docx4j 11.4.5 is now available in Maven Central.
For downloads, go to https://www.docx4java.org/downloads.html
The logic behind the version number is as follows:
- its docx4j 11 since it targets Java 11; If you are not using Java 11 or later, you should stick with docx4j 8.3.4 (compiled for Java 8).
- it is docx4j 11.4, not 11.3, since this release is the first to use jakarta.xml.bind (as opposed to the previous javax.xml.bind); you may need to do a search/replace to accommodate this, see below
- it is docx4j 11.4.5, since it has feature parity with docx4j 8.3.4, but also includes OSGi info in META-INF/MANIFEST.MF (so incrementing from .4 to .5)
Since this release uses jakarta.xml.bind, rather than javax.xml.bind, if you have existing code which imports javax.xml.bind, you'll need to search/replace across your code base, replacing javax.xml.bind with jakarta.xml.bind. You'll also need to replace your JAXB jars (which Maven will do for you automatically; otherwise get them from the relevant zip file).
From hereon, changes will generally be made in this 11.4 branch first.
Here are some of the changes since 11.3.2:
- Uses jakarta.xml.bind, rather than javax.xml.bind (hence the 11.4.x numbering); if you have existing code which imports javax.xml.bind, you'll need to search/replace across your code base, replacing javax.xml.bind with jakarta.xml.bind
- Use jakarta JAXB deps, and bump various other deps
- Writes OSGi info to META-INF/MANIFEST.MF
- Parity with 8.3.4 (docx to PDF via XSL FO: Font configuration fixed; Use FOP 2.7)
8.3.3 docx to PDF via XSL FO reworked FOP configuration:
- new property docx4j.convert.out.fo.hyphenate must be set to true for hyphenation to occur
- baseURI can be configured at docx4j.convert.out.fop.FopConfParser.defaultBaseURI; it now defaults to the current directory (".")
- you can set your own custom resource resolver if necessary
You may need to make some minor changes to how it is invoked; see the example
at https://github.com/plutext/docx4j/blob/ ... .java#L170
8.3.3 Reinstate Panose support, required for best matching font mapper to work correctly. To use this, you'll first need to delete .docx4j/fop-fonts.cache to force docx4j to re-read the fonts
11.4.5 is a JPMS modularised release, so the docx4j jars contain module-info.class entries, with the following exceptions:
- the docx4j-documents4j-* sub-projects don't have a module-info.java until https://github.com/documents4j/documents4j/issues/108 is addressed
- the docx4j-conversion-via-microsoft-graph sub-project doesn't have a module-info.java
docx4j 11.4.5 source code can be found in branch https://github.com/plutext/docx4j/tree/VERSION_11_4_5