Formatted TextArea html

Formatted TextArea html

Forum member · Jan 23, 2013
I have a text like so: <p><b>lalala</b>blaaaa</p><p>more text</p>(large chunk of html text). the formatted text area shows tags. instead of rendering it properly. I realize it is possible to set the textarea to bold etc. programmatically, but I need it to render the text differently depending on what tag it encounters in the large chunk of text.

Re: Formatted TextArea html

Forum member · Jan 23, 2013
A correction to my previous post my html actually shows like this. "<p><span style=\"text-decoration: underline;\"><strong>æklsjgfhnræunjrfgæoiurgnjwrse</strong></span></p> " could this be the issue?

Re: Formatted TextArea html

Support · Jan 23, 2013
Hello, The version 3 DynamicPDF Generator for .NET product supports some limited number of HTML tags and you can add HTML text using these supported HTML tags. Please refer documentation on supported HTML tags by our HtmlTextArea here . If you are working with the TextArea page element then you can set only one font to the whole text within the TextArea. It is not possible to set different styles for substring within TextArea page element using our DynamicPDF Generator for .NET product. Thanks, ceTe Software Support Team.

Re: Formatted TextArea html

Forum member · Jan 28, 2013
According to the description of the formattedTextArea here: http://www.dynamicpdf.com/Support/NET_Help_Library/html/ceTeDynamicPDFPageElementsHtmlTextArea.htm this clearly indicates that I should be able to render text that appears like this: <p><b>bold</b></p><p><b><i>bold and italic</i></b></p>

Re: Formatted TextArea html

Support · Jan 28, 2013
Hello, In order to add the text with bold and bold italic style you will need to build respective font objects using bold and bold italic fonts then you will need to create FontFamily object using the font objects and add it to the FontFaces of the HtmlTextArea. Below is the sample code for it. Document document = new Document(); Page page = new Page(); //Building font objects and FontFamily object. TrueTypeFont verdanaRegularFont = new TrueTypeFont("verdana.TTF"); TrueTypeFont verdanaBoldFont = new TrueTypeFont("verdanab.TTF"); TrueTypeFont verdanaBoldItalicFont = new TrueTypeFont("verdanaz.TTF"); TrueTypeFont verdanaItalicFont = new TrueTypeFont("verdanai.TTF"); FontFamily verdanaFontFamily = new FontFamily("VerdanaFontFamily", verdanaRegularFont, verdanaBoldFont, verdanaItalicFont, verdanaBoldItalicFont); string text = "<p><b>bold</b></p><p><b><i>bold and italic</i></b></p>"; HtmlTextArea htmlTextArea = new HtmlTextArea(text, 100, 100, 300, 200, verdanaFontFamily, 12, true); htmlTextArea.FontFaces.Add(verdanaFontFamily); page.Elements.Add(htmlTextArea); document.Pages.Add(page); document.Draw(@"C:\MyDocument_v3.pdf"); Thanks, ceTe Software Support Team.

Re: Formatted TextArea html

Forum member · Jan 28, 2013
This is perfect! thank you very much