I'm using Poi/Xdocreport pdf converter on a Tomcat server. Very simple implementation in code:
InputStream doc = new FileInputStream(new File(documentPath));
XWPFDocument document = new XWPFDocument(doc);
PdfOptions options = PdfOptions.getDefault();
File pdfFile = new File(pdfFilePath);
OutputStream out = new FileOutputStream(pdfFile);
PdfConverter.getInstance().convert(document, out, options);
While it works fine for most docx documents, when the document uses heading paragraph styles, the text overlaps when wrapping (the heading is forced to be displayed in one row)—rendering the pdf document practically unreadable. Versions are
fr.opensagres.poi.xwpf.converter.pdf-2.0.4
xdocreport version 2.0.4
poi 5.2.2.
Any help very much appreciated!
Source docx:
Resulting pdf: