PDF Converter in a Java environment

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

To test your document online, or to download an installer, please see 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.)

Out of the box, version 3.3.0 of docx4j uses

To convert to PDF, use the docx4j facade:

Docx4J.toPDF(wordMLPackage, os)

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

You should however install your own instance! You can download an installer from the PDF Converter downloads page

To use your own instance, 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.