Hysen Labs
Library / SDK
plutext/docx4j avatar
plutext

docx4j

JAXB-based Java library for Word docx, Powerpoint pptx, and Excel xlsx files

2,379 stars1,232 forksJavaLicense varies
DEEP OPEN-SOURCE ANALYSIS

docx4j

A JAXB based Java library for creating, editing and saving OpenXML packages including Word docx, PowerPoint pptx and Excel xlsx files.

What the library does

docx4j is an open source library, described in the README as Apache v2, for creating, editing and saving OpenXML packages. It uses JAXB to build the Java representation of the documents. It can open existing docx, pptx and xlsx files, create new ones, and programmatically manipulate anything the file format allows. Document generation is supported through variables, content control data binding and MERGEFIELD, and CustomXML binding covers pictures, rich text, checkboxes and OpenDoPE extensions for repeats and conditionals, including importing XHTML. It can export to HTML and to PDF using three strategies, and it handles font substitution and embedded fonts.

Version lines

The project maintains several version tracks tied to Java and JAXB generations. docx4j 17.0.0 targets Java 11 and is compatible with Java 17, 21 and an expected Java 25, using the Jakarta XML Binding API 4.0. Version 11.4.5 uses Jakarta XML Binding 3.0, which means code importing javax.xml.bind must be search replaced to jakarta.xml.bind. docx4j 8 is the legacy Java 8 line and is explicitly marked not supported. The README notes the version number jumped from 11.5.14 to 17.0.0 to flag three significant changes, including generated objects built from XSDs at build time and a new deepCopyFast method.

Building and community

docx4j is a multi module Maven project. Building from GitHub uses mvn clean then mvn install, with a note that some tests may fail on Windows and can be skipped using mvn install -DskipTests. The README links a developer mailing list for anyone working with the source, a downloads page for binaries, a getting started guide in the docs tree, a cheat sheet blog post, and sample code under src/samples. Users choose exactly one docx4j-JAXB implementation dependency matching their JAXB provider.

Editorial conclusion

The library is described as Apache v2 and reported two thousand three hundred seventy nine stars with one thousand two hundred thirty two forks at indexing, with sample code and a cheat sheet available in the repository.

DEEP OPEN-SOURCE ANALYSIS

Official sources

Community notes

Community notes