Last word of generated pdf differs

After converting the sample.doc to pdf the layout of the file is changed. It changes the last word of the converted file on a page to be different than that of the source file.

manuscript-r0.pdf (296.0 KB)
SampleDoc.docx (36.8 KB)

@TandFSP I cannot reproduce the problem on my side using the latest 23.9 version of Aspose.Words for Java. There is slight difference if not use text shaping engine, but if enable text shaping the document is rendered exactly as MS Word:

<dependency>
	<groupId>com.aspose</groupId>
	<artifactId>aspose-words</artifactId>
	<version>23.9</version>
	<classifier>jdk17</classifier>
</dependency>
<dependency>
	<groupId>com.aspose</groupId>
	<artifactId>aspose-words</artifactId>
	<version>23.9</version>
	<classifier>shaping-harfbuzz-plugin</classifier>
</dependency>
Document doc = new Document("C:\\Temp\\in.docx");
doc.getLayoutOptions().setTextShaperFactory(com.aspose.words.shaping.harfbuzz.HarfBuzzTextShaperFactory.getInstance());
doc.save("C:\\Temp\\out.pdf");

Here is the produced output: out.pdf (118.3 KB)

As I can see in your output PDF Fanwood font is used. Fanwood font is the last resort font used by Aspose.Words when no other fonts are available in the environment where document is rendered. Most likely the problem occurs because fonts required for document rendering are not available in your environment. To build an accurate document layout the fonts are required. If Aspose.Words cannot find the fonts used in the document the fonts are substituted . This might lead into the layout and appearance difference. You can implement IWarningCallback to get a notification when font substitution is performed.
The following articles can be useful for you:
https://docs.aspose.com/words/java/specify-truetype-fonts-location/
https://docs.aspose.com/words/java/install-truetype-fonts-on-linux/
Please try either installing or providing the fonts required to render the document. This should resolve the problem.

I am using Aspose 23.8 for java on macOS (version 12.6.8)
I have tried using the shaping-harfbuzz-plugin but it gives this error.

Handler dispatch failed; nested exception is java.lang.UnsatisfiedLinkError: com.aspose.words.shaping.harfbuzz.HB.hb_font_create_from_data([BI)J

Here is the attached screenshot for the complete error.
Screenshot 2023-10-18 at 6.39.27 AM.jpg (234.8 KB)

@TandFSP For Windows platforms no additional efforts are required for installing HarfBuzz because Aspose.Words.Shaping.Harfbuzz already includes compiled HarfBuzz library.
For other systems, Aspose.Words.Shaping.Harfbuzz relies on already installed HarfBuzz library. For instance, many Linux-based systems have HarfBuzz installed system-wide by default. If not, there is usually a package available for installing via package manager.