Plutext

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 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.)

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 http://127.0.0.1:9016/, 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 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", 
    "https://converter-eval.plutext.com:443/v1/00000000-0000-0000-0000-000000000000/convert");

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