aspose-words / Aspose.Words-for-Java

Aspose.Words for Java examples, plugins and showcases
https://products.aspose.com/words/java
MIT License
401 stars 206 forks source link

Missing text when convert word to pdf #90

Closed liuyi520123 closed 1 year ago

liuyi520123 commented 2 years ago

I install specified fonts in windows and all text looks normal. when i use aspose.word to convert, it missing most words, i upgrade aspose.word to 22.8, it also missing.

FontSettings fontSettings = new FontSettings();
fontSettings.setFontsFolder(FZ_FONTS_FOLDER, true);
fontSettings.getSubstitutionSettings().getDefaultFontSubstitution().setDefaultFontName("FZSongS-Extended");

document.getLayoutOptions().setTextShaperFactory(HarfBuzzTextShaperFactory.getInstance());

document.setFontSettings(fontSettings);

document.save(FZ_PDF_PATH, SaveFormat.PDF);

what can I do to make the pdf normal, thank you very much.

docx image

pdf image

I test it with program, the docx file and the font files are in program too.

it can download from example.

AlexNosk commented 2 years ago

@liuyi520123 Unfortunately, I do not have baidu account. Could you please share the documents ad fonts on google drive? Also, please note Aspose.Words forum is the main place for support. So let's continue discussion in the forum: https://forum.aspose.com/t/missing-text-when-convert-word-to-pdf/251042