Burmese-Myanmar font appear as boxes and Khmer - Cambodian font does not appear at all on PDFs

Hi Team,
I am having issues with my PDF export for KHMER - Cambodian language not appearing in the PDFs and same way the Myanmar font appears as boxes. I tried using Aspose.PDF for .Net 17, the most recent version and I see the issue still exists.

Attached are the PPTs and code file FYR.
Aspose to Share.zip (183.9 KB)

I am using KHMER UI Font and MYANMAR UI FONT in my server.

Please suggest a solution.

Hi,
Any update on this?

@Priyarav87

Thanks for contacting support.

We have checked the code snippet and files which you have shared and were unable to find any PPT file. Furthermore, the code file only have the code to merge the documents. Would you please add some more details of the scenario with related files and code snippet, so that we can test the scenario in our environment and address it accordingly.

Sorry I had attached the exported PDFs. The code is where we are converting (making use aspose) byte stream to be converted to a PDF.

@Priyarav87

Please share the respective source input file(s), from which you have exported the shared PDF document. This way we can test the scenario accordingly.

I dont have any source input file. We fetch the data from resx files and create a PDF.

Here are attached resx resource files for both languages. Can u pls try to create a PDF with these and see if you are able to replicate the issue?

KHMER Cambodian (km-KH) Text does not even appear in the exported pdf

Burmese Text (my-MM) is appearing as boxes in the exported PDF.

Please look for CopyRight in the attached files for each language. ( data name=“CopyRight” xml:space=“preserve”)

Aspose- KhmerMyanmarResx.zip (3.8 KB)

@Priyarav87

Thanks for sharing respective files.

Please make sure to install fonts in your environment which support full characters of respective languages. We have tested the scenario by installing Khmer UI and Zawgyi-One fonts in our environment, which support KHMER and BURMESE languages respectively and text was fine and readable in the generated PDF. For your reference, we have attached generated PDF and used font files along with code snippet as well.

Document doc = new Document();
var page = doc.Pages.Add();
TextFragment KHMER = new TextFragment("KHMER => នេះជាអត្ថបទភាសាខ្មែរ. រក្សាសិទ្ធិគ្រប់យ៉ាង");
KHMER.TextState.Font = FontRepository.FindFont("Khmer UI");
KHMER.Margin = new MarginInfo(10, 10, 10, 10);
TextFragment Burmese = new TextFragment("Burmese => ။ အခြင့္အေရးမ်ားအားလံုး ထိန္းသိမ္းပိုင္ခြင့္ကို လက္၀ယ္ထားရွိထားသည္။");
Burmese.TextState.Font = FontRepository.FindFont("Zawgyi-One");
page.Paragraphs.Add(KHMER);
page.Paragraphs.Add(Burmese);
doc.Save(dataDir + "KHMER_and_Burmese.pdf");

font_files.zip (345.0 KB)
KHMER_and_Burmese.pdf (48.5 KB)

However, we have also observed that the Burmese characters were cut off from above edges in the generated output. For the sake of correction, we have logged an issue as PDFNET-43657 in our issue tracking system. We will further look into the details of the issue and keep you posted with the status of its correction. Please be patient and spare us little time.

We are sorry for the inconvenience.

Could you please let me know which version of aspose.pdf you have used for this? Because I still see the same issue after installing the fonts.

I am using aspose.PDF 9.8 because we have a license it restricts me from using the recent version of aspose. Also with the new fonts, I was able to see myanmar getting fixed, however I am still seeing a missing text for the KHMER cambodian language. Please see attached Documents (3).zip (252.0 KB)

Hi Team,
Somehow I tried to use trial aspose.pdf 17.0 and tried to do the export. The PDF is still missing the text for cambodian language. Could you please help me on this?

@Priyarav87

Thanks for your inquiry.

Please note that each font has specific metrics and an abstract square whose height is the intended distance between lines of type in the same type size. This square is called the em square and it is the design grid on which the glyph outlines are defined. Many letters of input font have points which are placed out of font’s em square bounds.

In order to display this font correctly, usage of special setting is needed. In latest version Aspose.Pdf for .NET 17.11 Aspose.Pdf.Text.TextFormattingOptions class has been introduced. This class has a an enumeration LineSpacingMode which is designed for specific fonts like you are using in your scenario.

Also class Aspose.Pdf.Text.TextFormattingOptions has a property LineSpacing of type LineSpacingMode. Please just set LineSpacing into LineSpacingMode.FullSize. So, code snippet to get correct PDF will be like this:

Document doc = new Document();
var page = doc.Pages.Add();
TextFragment KHMER = new TextFragment("KHMER => នេះជាអត្ថបទភាសាខ្មែរ. រក្សាសិទ្ធិគ្រប់យ៉ាង");
KHMER.TextState.Font = FontRepository.FindFont("Khmer UI");
KHMER.Margin = new MarginInfo(10, 10, 10, 10);
TextFragment Burmese = new TextFragment("Burmese => ။ အခြင့္အေရးမ်ားအားလံုး ထိန္းသိမ္းပိုင္ခြင့္ကို လက္၀ယ္ထားရွိထားသည္။");
Burmese.TextState.Font = FontRepository.FindFont("Zawgyi-One");
Burmese.TextState.FormattingOptions = new TextFormattingOptions();
Burmese.TextState.FormattingOptions.LineSpacing = TextFormattingOptions.LineSpacingMode.FullSize;
page.Paragraphs.Add(KHMER);
page.Paragraphs.Add(Burmese);
doc.Save(dataDir + "KHMER_and_Burmese.pdf");

KHMER_and_Burmese.pdf (48.5 KB)

Please also note that we always recommend our customers to use latest version of the API, because latest version contains more fixes and enhancements. Please try the scenario with latest version of the API and in case you still face any issue, feel free to let us know.