Plutext

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 Sample.java

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 converter-eval.plutext.com

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 docx4j.properties; a sample properties file can be found on GitHub

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

Or alternatively, you could set the property programmatically:

Docx4jProperties.setProperty(
    "com.plutext.converter.URL", 
    "http://converter-eval.plutext.com:80/v1/00000000-0000-0000-0000-000000000000/convert");

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