html in unorderedlist

html in unorderedlist

Forum member · Aug 7, 2014
What is the best way to handle a bullet in an unorderedlist that contains html such as an anchor tag to a web page such as More information can be found <here> where here is an anchor tag?

Re: html in unorderedlist

Support · Aug 8, 2014
Hello, The UnorderedList page element of the DynamicPDF API does not support adding HTML to the PDF. If you would like to display the bullets for the UnorderedList then you can use the UnorderedListStyle enumerator for setting it. You can refer to the documentation on UnorderedList page element here . Below is a line of code for it. UnorderedSubList subList1 = item1.SubLists.AddUnorderedSubList(UnorderedListStyle.Disc); Also if you would like to add HTML to the PDF then you can use the FormattedTextArea class of Generator API but please note that it does not supports list and anchor tags. Also in order to add the bullet symbol to the PDF through the FormattedTextArea, you will need to use the correct Unicode value. Below is code sample for it. You can refer to the documentation on FormattedTextArea here and supported HTML tags here . Document document = new Document(); Page page = new Page(); document.Pages.Add(page); //Below code adds bullet using \u2022 Unicode value. string formattedText = "<p> \u2022 This is to add bullet symbol </p> "; FormattedTextAreaStyle style = new FormattedTextAreaStyle(ceTe.DynamicPDF.FontFamily.Helvetica, 12, false); FormattedTextArea formattedTextArea = new FormattedTextArea(formattedText, 0, 0, 90, 15, style); formattedTextArea.Height = formattedTextArea.GetRequiredHeight(); page.Elements.Add(formattedTextArea); document.Draw(@"C:\Temp\MyDocument.pdf"); Regarding adding link to the PDF you can use the Link page element of Generator API. You can control the position of the links using X and Y position coordinates. You can refer to the documentation on Link page element here . Thanks, ceTe Software Support Team.

Re: html in unorderedlist

Forum member · Aug 8, 2014
I will give that a try. Thanks.