Cambodia and Burmes text not right after converting to Pdf

we are using different fonts of template Burmese and Khmeer
while saving to word its working fine and saving to Pdf showing boxes

@manasag

It seems that you are experiencing issues with displaying Khmer and Burmese text correctly in PDF format, where the text appears as boxes. This typically occurs when the font used does not support the specific Unicode characters for these languages.

To resolve this issue, you can try the following steps:

  1. Use Compatible Fonts: Ensure that the fonts you are using for Khmer and Burmese text are capable of displaying these characters. Fonts like “Noto Sans Khmer” for Khmer and “Noto Sans Myanmar” for Burmese are good options as they support a wide range of Unicode characters.

  2. Font Substitution: If you are using Aspose.Cells, you can utilize the PdfSaveOptions.setFontSubstitutionCharGranularity() method. By setting this property to true, you can ensure that only the specific characters that cannot be displayed by the chosen font will have their font changed, while the rest of the text remains unaffected. This can help maintain the integrity of your text formatting.

  3. Embed Fonts: When saving your document to PDF, make sure to embed the fonts used in the document. This ensures that the PDF viewer can render the text correctly, even if the viewer does not have the fonts installed.

  4. Check for Updates: Ensure that you are using the latest version of Aspose libraries, as updates may include improvements and fixes related to font handling and Unicode support.

By following these steps, you should be able to improve the rendering of Khmer and Burmese text in your PDF documents. If the problem persists, consider checking the documentation or reaching out to the support community for further assistance.

Sources:
[1]: Change the Font on just the specific Unicode characters while saving to PDF

I tried with this two fonts, still seeing same can you please help me.

@prathibareddy

Can you please share the sample code as well? We will test the scenario in our environment and address it accordingly.

@prathibareddy

Can you please share the sample code as well? We will test the scenario in our environment and address it accordingly.

		Document doc = new Document("/template/New folder/test.dot");
		DocumentBuilder builder = new DocumentBuilder(doc);
		builder.writeln("khmer  សាកល្បងភាសាខ្មែរ");
		builder.writeln("Burmese  အရေးကြီးသည့်အချက်- ");

		doc.save("/template/New folder/testLanguagefont.pdf");
		PdfResponseBO pdfResponse = new PdfResponseBO("200",PrintServerBoImplConstants.PDF_SUCCESS,null,null,0,null);

@prathibareddy Most likely the problem occurs because the font is not properly installed or is not accessible. 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/