For some reason I cannot get the PdfConverter from Apache POI to convert my MS Word document properly on a Linux machine. On Windows and MacOS it seems to work fine but whenever I try it on a Linux machine it basically doesn't convert the UTF-8 characters. I also tried to configure the fontEncoding option which can be passed to the PdfConverter but that doesn't seem to help.
final InputStream in = new FileInputStream(new File("src/test/resources/SOMEDOC.docx"));
final XWPFDocument document = new XWPFDocument(in);
final OutputStream out = new FileOutputStream(new File("target/test.pdf"));
final PdfOptions options = PdfOptions.getDefault();
// This actually breaks the whole conversion. No text will be displayed if you set this font encoding option to UTF-8
options.fontEncoding("UTF-8");
PdfConverter.getInstance().convert(document, out, options);
Does anybody know what I am doing wrong here?