@malrefaee Your document is converted properly using the latest 23.1 version of Aspose.Words for Java:
- PDF docuemnt produced by Aspose.Words: aw.pdf (102.7 KB)
Also, you should note that by default MS Word uses font open type features. Aspose.Words.Shaping.Harfbuzz package provides support for OpenType features in Aspose.Words using the HarfBuzz text shaping engine. You should enabling open type features to get the result closer to MS Word’s result. To achieve this you should add reference to Aspose.Words Shaping Harfbuzz plugin:
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-words</artifactId>
<version>23.1</version>
<classifier>shaping-harfbuzz-plugin</classifier>
</dependency>
and use the following code for conversion:
Document doc = new Document("C:\\Temp\\in.docx");
// Set fonts sources if required.
doc.setFontSettings(new FontSettings());
doc.getFontSettings().setFontsSources(new FontSourceBase[]{new FolderFontSource("C:\\Temp\\fonts", true)});
// Enable open type features
doc.getLayoutOptions().setTextShaperFactory(com.aspose.words.shaping.harfbuzz.HarfBuzzTextShaperFactory.getInstance());
doc.save("C:\\Temp\\out.pdf");