Special Characters & New lines - Windows and Linux differences

Hello,

We are generating pdfs using Aspose Word version 24.1

  1. When we generate on our localhost (Windows) all special characters are displayed correctly in the pdf and new lines are added. The template placeholder special characters include bullet points, single quotation marks and a few others.

When generating on Linux the special characters are displayed as ‘?’.

The font used is installed on both Windows and Linux.

  1. We have added some character replacement checks in the Java code and added the -html attribute to the placeholder. This works for some of the special characters on both Windows & Linux but the newlines are not respected - we have tried replacing the \n with a
    but this does not work.

Attached are the sample documents.

Any help is appreciated.
Aspose.zip (129.9 KB)

@pm11 The problem is definitely in fonts. As I can see in your output PDF documents different fonts are used on Linux and on Windows. If Aspose.Words cannot find the fonts used in the document the fonts are substituted. This might lead into the layout differences due to differences in fonts metrics. 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/