PDF Converter in a Java environment

This page covers invoking the PDF Converter in a Java environment:

To try your docx now, please click here

Java API

You can find sample client code at

It uses:

to POST docx content to the Converter endpoint URL

You can configure the endpoint at line 37 in the sample code

Docx4j users

From version 3.3.0, docx4j uses the PDF Converter by default. (If you are using an earlier version of docx4j, you can/should use the above approach.)

To convert to PDF, use the docx4j facade:

Docx4J.toPDF(wordMLPackage, os)

where wordMLPackage is a docx4j wordMLPackage, and os is an OutputStream.

Out of the box:

You can download an installer from the PDF Converter downloads page

If your installation is not at, you will need to tell docx4j where it is.

You can do that via docx4j property "com.plutext.converter.URL".

You should set that in; a sample properties file can be found on GitHub

Add to your classpath, if you didn't have it already.

Or alternatively, you could set the property programmatically:


The only part of the URL you should alter is host name and port.