Hindi characters

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v6)  /  Hindi characters

DynamicPDF CoreSuite for .NET (v6) Forum

 Mar 19 2014 3:50 PM
Hi.

I am having some issues when trying to render a PDF which contains Hindi characters. Is there something I need to consider? I've looked through the documentation and the forum as well, and I don't see how to make it work. Is there any example you can provide that allows me to see how I should set the Font or Label objects so the content is displayed correctly?

Thanks!
 Mar 20 2014 4:53 PM
Posted by a ceTe Software moderator
Hello,

Please email over the following information to our support team at support@cete.com so we can get a better idea as to what you have tried so far. Based on this info we will be able to answer your questions accurately and/or point you in the right direction.

1. PDF Output.
2. Code used.
3. Open type or true type font files (if any) used.
4. Version & build numbers of DynamicPDF dll used.

Thanks,
ceTe Software Support Team.
 Jul 30 2015 11:53 AM
Hi,
Can you please provide an example of how to use Hindi / Thai characters? What are the fonts should be used?

Regards.
 Jul 30 2015 4:32 PM
Posted by a ceTe Software moderator
Hello,

Currently the DynamicPDF for .NET API does not support Thai and Indic language characters. We have added this feature to our wish list for consideration and at this time we don’t have an exact time line on when this feature will be available.

Thanks,
ceTe Software Support Team.
 Jul 31 2015 5:12 AM
Hi,

This is a huge setback for us. We must have Hindi characters.

When should it be available? If not soon, we'll, unfortunately, have to move to another solution.

Out of curiosity: what's so complicated in implementing Hindi characters?

Regards.
 Aug 03 2015 3:39 PM
Posted by a ceTe Software moderator
Hello,

Languages like Thai & Hindi require complex scripting or complex text layout (CTL) where the shape and position of a character changes depending on its relation to other characters. This adds a lot of complexity to the implementation.

Our development team is considering support for CTL languages. However, implementing CTL is a very complex task and will take a lot of time. At this time we do not have a specific time frame on when support for CTL languages will be available.

Thanks,
ceTe Software Support Team.
 Aug 09 2015 7:54 AM
Hello,
Thanks for your reply.

What we did is the following: checked if input text contains Thai and if yes use Thai's open type font (example code below).
It works fine. What are we missing?


Example code:
if (Regex.IsMatch(InputValue, @"\p{IsThai}"))
{
        ceTe.DynamicPDF.Font InputFont = new                                         ceTe.DynamicPDF.Text.OpenTypeFont("ANGSAU.TTF");

        ceTe.DynamicPDF.PageElements.Label l = new                 ceTe.DynamicPDF.PageElements.Label
                (InputValue, InputX, InputY, InputWidth, InputHeight,                 InputFont);
}

Regards.
 Aug 11 2015 2:22 PM
Posted by a ceTe Software moderator
Hello,

It is possible that the specific font (ANGSAU.TTF) you are using may not be using complex text layout in which case that font may work.

Thanks,
ceTe Software Support Team.
 Jan 25 2023 2:20 PM
Hello,

We are now in 2023. Is Hindi characters now supported in any version of the DynamicPDF?

I really need this. I am using cete.dynamicpdf.coresuite, version 11.37.0.47488

Thank you
 Jan 26 2023 1:31 PM
Posted by a ceTe Software moderator
Hi,

Yes, you can add Hindi language text to the PDF document using the latest version of our product. You will have to use a supported font file to achieve this.

Please refer to the HelloWorldLanguages example present in our GitHub examples.

Thanks,
ceTe Software Support Team
 Jan 26 2023 2:38 PM
Hi

Thanks for your reply.

I have done this...based on your hello world example.

It didn't work for my situation.  Let me explain my situation.

I have both English and Hindu characters saved in the database.
I retrieve these English and hindi text and I append it to a text Area object.

I  use it to build a pdf download the pdf.

When I open the downloaded pdf file, the English characters from the dB show but the hindi characters do not show but instead just shows blank space.

Further, when I copy the blank space where d hindi characters were meant to be displayed on d pdf and paste to a Word file, the hindi characters show up.

So it means the document.Draw() method is unable to draw the hindi characters from the database.


I need help pls
 Jan 27 2023 4:07 PM
Posted by a ceTe Software moderator
Hi,

You may be using a font that does not have Hindi glyphs. Please send your output PDF, the code used to create it and the font file(s) the code uses to support@dynamicpdf.com and we will take a look at it and post a response here.

Thanks,
ceTe Software Support Team
 Jan 30 2023 3:27 AM
Hello,

Thank you for you reply.

Here it is below:

        private TextArea GetTextArea(PDFAdaptiveText element, string textValue = null)
        {
            var textArea = new TextArea(textValue == null ? element.Value ?? "" : textValue, element.XPos, relativeY + element.YPos, element.Width, element.Height);
            textArea.Underline = element.UnderlineText;

            //string DevnewFont = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "wwwroot\\Devnew.ttf");
            //Font InFont = new OpenTypeFont(DevnewFont, true);
            //if (!string.IsNullOrEmpty(element.Font)) textArea.Font = InFont;

            if (!string.IsNullOrEmpty(element.Font)) textArea.Font = Font.HeiseiKakuGothicW5;
            textArea.FontSize = element.FontSize;
            return textArea;
        }


Please note that I have also used all the other Fonts provided by the DynamicPDF Font class.




 Jan 30 2023 10:17 AM
Posted by a ceTe Software moderator
Hi,

We tested this and are able to add Hindi and English language text to a PDF using a single TextArea.

Here is a code sample:

            Document document = new Document();
            Page page = new Page();
            document.Pages.Add(page);
           
            OpenTypeFont hindiFont = new OpenTypeFont(@"Nirmala.ttf");
            TextArea area1 = new TextArea("Test Hindi text: नमस्ते added.", 0, 100, 200, 12, font, 12);
            page.Elements.Add(area1);
            area1.Font = hindiFont;

            document.Draw(@"C:\Temp\fontOutput.pdf");

If you continue facing an issue then please send over following information to support@dynamicpdf.com so we can look into it further.

1. Simple Console application which uses static data to recreate the behavior.
2. Font files used.
3. Output PDF.

Thanks,
ceTe Software Support Team
 Jan 30 2023 12:03 PM
Hi,

This worked,

Thank you.

All times are US Eastern Standard time. The time now is 11:26 PM.