Hindi Word DOC to PDF Conversion using Montserrat Font (C# .NET)

When we use aspose word and create doc file and use font
Merriweather Black
Montserrat SemiBold
Merriweather
Montserrat and save this doc file in pdf test is blank

@SU84168900,

Have you also tried the latest (21.7) version of Aspose.Words for .NET on your end? In case the problem still remains, then please compress the following resources into ZIP format and attach the .zip file here for testing:

  • A simplified source Word document you are getting this problem with
  • Font files used in above Word file
  • Aspose.Words generated output PDF file showing the undesired behavior

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

using System.docx (15.5 KB)
output8d46addb-52c8-4c3e-8b64-e1d1bc7ecd07.pdf (33.1 KB)

Hi,
Can’t upload zip file because file size is big i have attached code and output file .
Please help as soon as possible.

Thanks,
Susheel

@SU84168900,

First off, you are using a very old 16.1 version of Aspose.Words for .NET on your end. Please upgrade to the latest (21.7) version of Aspose.Words for .NET and see how it goes on your end?

Secondly, in your code, you are using Aspose.Words but applying license for Aspose.PDF API. You need to set license for Aspose.Words API using the ways mentioned in the following page:

In case the problem still remains, could you please compress the document (MON Report-Business case.doc) in .zip format and share it via OneDrive, Dropbox or any other file sharing service? Once we have your input Word document, we will then investigate it on our side and provide you more information.

Hi,
I have use latest version of Aspose.Words(21.7) and use Montserrat write Hindi in Word(दिग्विजय ने कहा- मोहन भागवत के बयान का मतलब है कि उनका और ओवैसी का भी एक) but in pdf not generate accurate hindu text in pdf file and I’ve attached out pdf which is generate from code .
Thanks,
output94fc01d9-6d2c-4787-a963-85409099a636.pdf (58.1 KB)

@SU84168900,

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

Aspose.Words.Document worddoc = new Aspose.Words.Document("C:\\Temp\\empty.docx");

Run run = new Run(worddoc, "महत्त्‍वपूर्ण विस्‍तारपूर्व गोष्‍ठी हैं:");

run.Font.NameFarEast = "Montserrat";
run.Font.NameAscii = "Montserrat";
run.Font.NameOther = "Montserrat";
run.Font.NameBi = "Montserrat";
run.Font.Name = "Montserrat";

run.Font.Size = 10.0;
run.Font.Bold = true;
run.Font.Italic = true;

worddoc.FirstSection.Body.LastParagraph.AppendChild(run);

worddoc.Save("C:\\Temp\\output.docx");

worddoc.LayoutOptions.TextShaperFactory = HarfBuzzTextShaperFactory.Instance;
worddoc.Save("C:\\Temp\\output Instance.pdf");

In case the problem still remains when running the above code on your end then please ZIP and attach the following font file here for further testing on our end:

  • Montserrat

Hi,
I have try with 20.12.0.0 aspose word and HarfBuzzTextShaperFactory 21.6.0.0 version

Aspose.Words.Document worddoc = new Aspose.Words.Document("C:\\Temp\\empty.docx");

Run run = new Run(worddoc, "महत्त्‍वपूर्ण विस्‍तारपूर्व गोष्‍ठी हैं:");

run.Font.NameFarEast = "Montserrat";
run.Font.NameAscii = "Montserrat";
run.Font.NameOther = "Montserrat";
run.Font.NameBi = "Montserrat";
run.Font.Name = "Montserrat";

run.Font.Size = 10.0;
run.Font.Bold = true;
run.Font.Italic = true;

worddoc.FirstSection.Body.LastParagraph.AppendChild(run);

worddoc.Save("C:\\Temp\\output.docx");

worddoc.LayoutOptions.TextShaperFactory = HarfBuzzTextShaperFactory.Instance;
worddoc.Save("C:\\Temp\\output Instance.pdf");

Please solve issue this version.
output Instancecc370c31-9b70-470e-9dd7-8c7f00436438.pdf (33.0 KB)

@SU84168900,

Please also ZIP and attach the following font file here for further testing on our end:

  • Montserrat

Please check the Word and PDF files.zip (28.6 KB) which were produced on my end by using the code from previous post. Please also manually convert above “output.docx” to PDF format by using “Save As” command of MS Word and attach MS Word generated PDF as well. Also, do you see the same problems in above output Instance.pdf file on your end? If yes, can you please also provide a comparison screenshot highlighting (encircle) the problematic area(s) in Aspose.Words generated output and attach it here for our reference? We will then investigate the issue further and provide you more information.

Report.zip (90.3 KB)
I have attached file which is try on 20.12.00 Aspose word .

@SU84168900,

First off, you are using an old (20.12) version of Aspose.Words; we suggest you to please upgrade to the latest (21.7) version of Aspose.Words for .NET. Secondly, for the proper rendering of such Hindi language text, you need to install fonts which are used in Word document. Please refer to following sections of documentation:

Can you please check if the Montserrat font is installed on your machine? Also, please provide that font so that we can be able to test this scenario further on our end. Thanks for your cooperation.