Render Thai Language Text in XLSX to PDF using C#

Hello and thank you for this article, I was able to resolve similar issue in my project. Now converting results from .docx to .pdf seems to be fine.

Unfortunately, i was not able to discover how to do the same for Aspose.Cells. I mean I have the same issue when converting .xlsx -> .pdf, and unfortunately neither Workbook nor Worksheet objects contain mentioned LayoutOptions property.

Could you please advice how to do the same for .xlsx files?

@Vitaly_Filatenko,

Please ZIP and attach the following resources here for testing:

  • Your simplified input Excel file in XLSX format
  • Aspose.Cells for .NET 20.7 generated output PDF file showing the undesired behavior
  • A comparison screenshot highlighting the problematic areas in this Aspose.Cells 20.7 generated PDF file (with respect to your source .xlsx file)
  • Custom font files used in Excel file
  • Any other necessary resources required to reproduce the issue on our end.

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

Source .xlsx, actual and expected .pdf (332.7 KB)

Comparison (14.2 KB)

No any custom fonts were used.

@Vitaly_Filatenko,

Please also provide the font “Leelawadee UI” file (.ttf file(s)), so we could test it precisely on our end.

By the way, I did test (without the font “Leelawadee UI” being installed) to convert your Excel file to PDF file format via Aspose.Cells APIs, it works ok although not perfect though. See the output file attached here.
out1.pdf (39.5 KB)

Are you sure that you have no Arial Unicode MS font installed? Because the converting works fine with this font installed, and probably that is why it worked for you.

As for requested Leelawadee UI – I’m not sure that this font is actually used in my source. All strings were formatted for “Times”.

@Vitaly_Filatenko,

If you could open your template file into MS Excel manually, double click on the A1 cell. Then select individual chars. You will notice, the font for the chars 5 - 7 is “Leelawadee UI”. So, kindly provide the font file, so we could evaluate the issue precisely.

Got it. Second word with Leelawadee UI. But first word in Times, whole second Thai line in Times, nothing were changed when I switched all to Times.

Anyway, please find the font attached: LeelawUI.zip (190.3 KB)

@Vitaly_Filatenko,

Thanks for the font file.

I am able to reproduce the issue as you mentioned by converting your template Excel file to PDF file format. First I installed the font “Leelawadee UI” and then tried the conversion code (Excel to PDF). I got the same output as yours. I have logged a ticket with an id “CELLSNET-47527” for your issue. We will look into it soon.

Once we have an update on it, we will let you know.

Please note I never installed this font manually, it seems to be distributed together with Windows 10 or MS Office.

@Vitaly_Filatenko,

You are right. I am using Windows 8 so the font may not be installed by default.

1 Like

@Vitaly_Filatenko,
After an initial investigation, we found this feature is not supported currently. We need some more time to evaluate it further. Once we will have some news for you, we will update you in this topic.