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!
Hindi characters
Re: Hindi characters
Support · Mar 20, 2014Hello,
Please email over the following information to our support team at [^a|mailto:support@cete.com|opennewwindow|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.
Re: Hindi characters
Forum member · Jul 30, 2015Hi,
Can you please provide an example of how to use Hindi / Thai characters? What are the fonts should be used?
Regards.
Re: Hindi characters
Support · Jul 30, 2015Hello,
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.
Re: Hindi characters
Forum member · Jul 31, 2015Hi,
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.
Re: Hindi characters
Support · Aug 3, 2015Hello,
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.
Re: Hindi characters
Forum member · Aug 9, 2015Hello,
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.
Re: Hindi characters
Support · Aug 11, 2015Hello,
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.
Re: Hindi characters
Forum member · Jan 25, 2023Hello,
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
Re: Hindi characters
Support · Jan 26, 2023Hi,
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
Re: Hindi characters
Forum member · Jan 26, 2023Hi
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
Re: Hindi characters
Support · Jan 27, 2023Hi,
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 [^a|mailto:support@dynamicpdf.com|opennewwindow|support@dynamicpdf.com^] and we will take a look at it and post a response here.
Thanks,
ceTe Software Support Team
Re: Hindi characters
Forum member · Jan 30, 2023Hello,
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.
Re: Hindi characters
Support · Jan 30, 2023Hi,
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 [^a|mailto:support@dynamicpdf.com|opennewwindow|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
Re: Hindi characters
Forum member · Jan 30, 2023Hi,
This worked,
Thank you.