docx to PDF output/conversion

Docx4j’s standard method of producing PDF output is via XSL FO, using Apache FOP.

Docx4j 2.8.1 can use Apache FOP version 1.0, 1.1. Forthcoming releases of docx4j can also use more recent builds of FOP.

Docx4j can also produce raw XSL FO, which is useful if you want to:

use some other FO processor, or

use FOP to produce PostScript, PCL, PNG/TIFF or other of FOP’s output formats

To try docx4j’s PDF output using FOP, choose a docx, and press the upload button. Note: if the document is 30 pages long, or its document.xml longer than 300KB, the faster 'non XSLT' code will be used. This code doesn't have feature parity yet.

We’re constantly improving the PDF output quality. But if what you see is a long way from what you require, you could try LibreOffice instead. If that works better for you, you can run it server-side using JODConverter.