I have two Linux machines, both running on CentOS 6. I use the same code below to convert Word to PDF
Document doc = new Document("/opt/1.doc");
doc.save("/opt/xx.pdf");
But the converted result is different, the formula converted by machine 2 is a box.
In order to eliminate consistency, I will reinstall the font of the machine that was converted incorrectly, ensuring that it is the same as another machine, but the result is still the same. I am going crazy and need help.
wordToPdf.zip (72.2 KB)
@zhengkai It looks like the difference is caused by different Symbol fonts used on different machines. Please try installing this Symbol font on your machine:
symbol.zip (46.2 KB)
I deleted all the fonts of the problematic machine and copied them from a normal machine for reinstallation. Why is there a font difference
Also, how do I know which issues caused garbled text during the PDF conversion process? I have tried “doc.setWarningcallbacks()” but have not received any output information
@zhengkai Please try putting the fonts into a separate folder and use this folder as a font source:
FontSettings.getDefaultInstance().setFontsSources(new FontSourceBase[] { new FolderFontSource("/temp/fonts", true) });
The Symbol bont might be already installed as default font in your OS.