I am using this code to convert docx to pdf:
try {
PdfOptions options = PdfOptions.create();
PdfConverter.getInstance().convert(firstDoc, out, options);
} catch (IOException ex) {
throw new IllegalArgumentException("Conversion failed.");
}
return prepareResponseEntity(out);
It works well on Windows, but when it's run on docker, the conversion skips symbols like "ąčęėįšųūž" and cyrillic.
I tried embedding fonts into the template. Changing the .docx template to Liberation fonts "sans" and importing its' ttf files, but nothing works. I can't install Microsoft fonts, because this app is used for commercial purposes.
What are my options?