We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Cambodian text not right after converting to pdf

I have a MS Word document that contains some Cambodian text. When it is converted to PDF the Cambodian text is wrong. MS Word uses the Leelawadee UI font to display the characters.
I will upload sample files.
problem_text.docx is the original MS Word document.
problem_text_from_msword.pdf is created using MS Word.
problem_text_from_aspose.pdf is created using Aspose.Words version 22.1

problem_text_from_aspose.pdf (51.2 KB)
problem_text_from_msword.pdf (40.4 KB)
problem_text.docx (12.4 KB)

@pehrsonak The issue occurs because the document uses advanced typography for Cambodian text.
Aspose.Words supports advanced typography via Aspose.Words.Shaping.HarfBuzz package. It is required to add a reference to this package and configure shaping before saving the document to pdf:

doc.LayoutOptions.TextShaperFactory = Aspose.Words.Shaping.HarfBuzz.HarfBuzzTextShaperFactory.Instance;

Please refer to https://docs.aspose.com/display/wordsnet/Enable+OpenType+Features for more information.
Here is output produced on my side with Aspose.Words.Shaping.HarfBuzz : out.pdf (23.4 KB)

1 Like