Converting Punjabi Word document to PDF (C# .NET) | Nirmala UI & Noto Sans Gurmukhi Fonts

I have a Word document written in Punjabi. When I attempt to convert it to PDF the Punjabi characters fail to render in the resulting PDF. Is this a known limitation?

PLAT-05 Consent Assent Addendum v1.0 2020.10.26_Punjabi.docx.zip (31.6 KB)

@jcapell,

Please try to Enable OpenType Features of Aspose.Words for .NET and see how it goes on your end?

Document doc = new Document("C:\\temp\\PLAT-05 Consent Assent Addendum v1.0 2020.10.26_Punjabi.docx");

doc.LayoutOptions.TextShaperFactory = HarfBuzzTextShaperFactory.Instance;

doc.Save("C:\\Temp\\21.3 HarfBuzzTextShaperFactory.pdf");

I am getting an exception: Type: System.DllNotFoundException
Message: Unable to load DLL ‘harfbuzz’: The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Is there a specific deployment pattern I need to be following for this to work? Or do I need to get the harfbuzz DLL separate from the Aspose harfbuzz package?

@jcapell,

Please install Aspose.Words.Shaping.HarfBuzz package from NuGet:

I was able to do this in a small test application. I am seeing the same results where some of the characters are rendered as rectangles that are not converted correctly. Attached is the resulting document.
Punjabi.zip (62.1 KB)

@jcapell,

Your Word document uses some custom fonts; so, please make sure that the latest versions of the following fonts are installed on your machine for proper rendering to PDF:

  • Nirmala UI
  • Courier New
  • Noto Sans Gurmukhi
  • Arial

Please refer to following section of documentation for more details: