When saving Word doc as PDF certain foreign language fonts aren't displayed correctly

I have a Word document that has instructions at the end in several foreign languages telling the recipient to call a number if they would like to speak to someone that can explain what the document says in their own language.

Most of these languages appear to be converted correctly (i.e. Korean, Chinese, Russian, Persian, etc.). However, there are a few that do not get converted properly. The Hindi language, using the Mangal font, for example, looks like it gets several characters in a handful of words transposed for some reason. The Lao language, using the Phetsarath OT font, doesn’t display correctly at all, and instead shows a series of squares, like the font is missing.

The Word document itself is saved with the “Embed fonts in the file” option checked, as well as the “Embed only the characters used in the document (best for reducing file size)” option checked.

The problem with the Lao language font displaying squares, like the font is missing, may be a separate problem as it displays properly when running from my local machine, but not when running on the server, but shouldn’t those “Embed fonts in the file” options make it so the font doesn’t need to be installed on the server?

Does anyone have a suggestion on how to fix, or how I should proceed?

FYI, here’s a zip file of a test program demonstrating what I’m encountering. I’ve included a sample Word document “Input.docx” with some foreign language text. The program will simply use Aspose.Words to open “Input.docx” and save it as “Output.pdf”. I’ve also included an image named “ScreenshotOfDiscrepencies.png” showing the differences between the input and the output. As I said previously, the Lao language looks correct when running locally, but not when running on our server, despite the “Embed fonts in the file” option being checked in Word.

@dhartley

Unfortunately, we have not found any attachment with your post. To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document.
  • Please attach the output PDF file that shows the undesired behavior.
  • Please attach the expected output PDF file that shows the desired behavior.
  • Please create a standalone console application ( source code without compilation errors ) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

I’ve attempted to upload a zip file multiple times (including just now with this reply). It says the uploaded completed, but I don’t see the zip file attached to my message. How can I do this?

Attempting to upload again…ForeignLanguageTest.zip (5.8 MB)

Oh, finally it worked. FYI, I had to delete the \bin and \obj folders from the .zip file.

@dhartley

Please note that Aspose.Words requires TrueType fonts when rendering document to fixed-page formats (JPEG, PNG, PDF or XPS). You need to install fonts that are used in your document on the machine where you are converting documents to PDF. Please refer to the following articles:

How Aspose.Words Uses True Type Fonts
How to Receive Notification of Missing Fonts and Font Substitution during Rendering

We suggest you please use the latest version of Aspose.Words for .NET 19.4. If you still face problem, please ZIP and attach ‘Raavi’, ‘Khmer UI’, and ‘Phetsarath OT’ fonts here for further testing. We will investigate the issue and provide you more information on it.

Hi Tahir, thanks for the quick reply. Unfortunately, the links you posted don’t appear to be working. I’ve tried opening them with different browsers but the pages never load.

In any event, I’ve updated my test program to reference Aspose.Words 19.4, and verified that the Raavi, Khmer UI, and Phetsarath OT fonts are installed on my machine, however the same characters are still being transposed. It’s very odd because it doesn’t display squares like the font is missing, it just seems to randomly transpose characters for some reason. Any help would be greatly appreciated.

FYI, here’s my updated test program. I also included the font files being used/referenced. ForeignLanguageTest.zip (6.8 MB)

As you can see, the characters for certain fonts are still being transposed.

@dhartley

We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-18461. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Thanks for the help Tahir. I look forward to seeing the fix.

The issues you have found earlier (filed as WORDSNET-18461) have been fixed in this Aspose.Words for .NET 21.5 update and this Aspose.Words for Java 21.5 update.