Hi, I’m using Aspose.PDF.Generator for .NET 3.5. So far the aspose API has all the functionality I need, but I don’t know how to embed a list inside a text paragraph.
- Element 1
- Element 2
Hi, I’m using Aspose.PDF.Generator for .NET 3.5. So far the aspose API has all the functionality I need, but I don’t know how to embed a list inside a text paragraph.
Hi Mikael,
Thanks for contacting support and sorry for the delayed response.
In order to accomplish your requirement, I would suggest you use HTML tags inside text. Please try using the following code snippet. For your reference, I have also attached the resultant file generated on my end.
You may also check HTML Tags in Text
C#
//Instantiate a Pdf document
Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf();
//Create a section in the Pdf document
Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add();
//Create string variables with text containing HTML tags
string s =
"use markdown "
<here>
Paragraph Starts here
<ol><li>Element 1</li><li>Element 2</li></ol>
Paragraph ends here
//Create text paragraphs containing HTML text
Aspose.Pdf.Generator.Text text1 = new Aspose.Pdf.Generator.Text(s);
text1.IsHtmlTagSupported = true;
//Add the text paragraphs containing HTML tags to section
sec1.Paragraphs.Add(text1);
//Save the Pdf document
pdf1.Save("c:/pdftest/TestHtml.pdf");