Exceptions occurring when trying to generate PDF with Hindi text

Hi,

we are trying to generate a PDF containing Hindi text. For example, during the generation of the text

वहनीय दस्तावेज़ स्वरूप

we see the following exception:

Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index 515552fb-af14-ee11-9905-ac180eecb8f8 System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at „‰ž.Šž.„(• , Int32 , UInt16[] , ‰ž , Boolean )
at „‰ž..‚(• , Int32 , Int32 )
at „‰ž..(• , Int32& )
at „‰ž.›.(• , Int32& )
at „‰ž.›.(• )
at „‰ž.”.(‘‰ž , • )
at a..Ž( ,  , • , String )
at a..(String )
at ..(String )
at .‹.( Font, encodedString, ‚& registeredPdfString)
at .‹.( encodedString, ‚& registeredPdfString)
at .ž–.(String str, ‚& registeredPdfString)
at –.š.(String unicodeString, ‹ resources, noCharacterAction, Boolean isEmbedded, Boolean isSubset, ‚& encodedString, & selectedFont, String& fontResourceKey)
at ”.“.’ž(•[] choosingStrategies, String unicodeString, ‹ resources, noCharacterAction, Boolean isEmbedded, Boolean isSubset, ‚& encodedText, & selectedFont, String& fontResourceKey)
at Œ..( , TextEditOptions )
at Aspose.Pdf.Text.TextSegment.set_Text(String value)
at Aspose.Pdf.Text.TextSegment.Œ(‹ )
at Aspose.Pdf.Text.TextBuilder.AppendText(TextFragment , Int32 , Boolean )
at š..(› )
at •.›.Accept(–š )
at •.›.Accept(–š )
at •.›.Accept(–š )
at •.›.Accept(–š )
at •.›.Accept(–š )
at •.›.Accept(–š )
at •.›.Accept(–š )
at •.›.Accept(–š )
at š..‹€(List`1 , Document , LoadOptions , Boolean )
at Aspose.Pdf.Document.aŸ(Stream , LoadOptions )

We are using Aspose.PDF for .NET version 10.5.1 (quite old, I know), and we would like to stay away from migrating to newer versions for now as the API has changed considerably since.

On my local machine, the PDF generation succeeds, but the resulting PDF incorrectly displays ‘empty squares’ instead of the Hindi characters. This leads me to believe that it might an issue related to fonts.

Can you please suggest steps we could take to be able to correctly generate the pdf?

Thanks,
P.

@ptdeveloper
I will still say that it is better to work with the new version of the library. The library API remains virtually unchanged. Accordingly, my main proposal is to switch to the newest version of the library as possible. Perhaps reinstalling some particular fonts will help you, but it is also possible that this exception (or black squares instead of symbols) is related to a software error, which most likely has already been fixed at the moment. According to the attached stacktrace, I can’t say for sure because of the fonts or because of an error in the library.