PDF conversion lose format when is converted by Docx4j
<p>I've a problem when pass file from <strong>.docx</strong> to <strong>pdf</strong>.</p>
<p>I use docx4j 3.2.2, the code for conversion:</p>
<pre><code>import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;

import org.docx4j.Docx4J;
import org.docx4j.openpackaging.packages.WordprocessingMLPackage;

public class PDFConverter {

    public static void main(String[] args) {
        createPDF();
    }

    private static void createPDF() {
        try {
            long start = System.currentTimeMillis();
            InputStream is = new FileInputStream(new File(&quot;docxFile&quot;));
            WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(is);
            OutputStream out = new FileOutputStream(new File(&quot;pdfFile&quot;));
            Docx4J.toPDF(wordMLPackage, out);
        } catch (Throwable e) {
            e.printStackTrace();
        }
    }
}
</code></pre>
<p>the conversion is realiced, but pdf lose the format, here the original docx and pdf conversion</p>
<p><a href="https://i.stack.imgur.com/dEFdh.png" rel="nofollow noreferrer">Original</a></p>
<p><a href="https://i.stack.imgur.com/AZso1.png" rel="nofollow noreferrer">Conversion</a></p>
<h3>This is because is needed some configuration?</h3>
<p>regards.</p>