Hi Groupdocs,
I am attempting to leverage the Java document conversion library, and I’m running into an issue setting the correct font of the PDF. This is how I’m calling the conversion API:
public FileInputStream convertWordInputStreamToPdf(InputStream wordInputStream) {
NoteLoadOptions noteLoadOptions = new NoteLoadOptions();
noteLoadOptions.setDefaultFont("./fonts/TimesNewRoman.ttf");
Converter converter = new Converter(wordInputStream, noteLoadOptions);
PdfConvertOptions options = new PdfConvertOptions();
String pdfFilePath = TempFileSystem.getTempPath(PDF_FILE_TYPE);
converter.convert(pdfFilePath, options);
Note: this only outputs the wrong font when I run in my docker container. I have mounted the ./fonts
directory in the container, however, and have validated that that mount works correctly when setting setting fonts for the Comparison api.
I’ve uploaded an example pdf output of the above code
test-convert-docx-to-pdf-times-docker.pdf (29.0 KB)
Can someone assist me with this? Am I setting the font correctly?
Thanks,
Jordan