Hello Lily,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Thanks for considering Aspose.
If you need to display the output with proper formatting, you need to specify the HTML tags within the text segment. Please visit the following link for more information on HTML Tags in Text
I case it does not satisfy your requirement or you've any further query, please feel free to contact.
We’re pretty happy with Aspose.Pdf kit so far t is working great in the project i!~
Just an extended question: when output a html block which include tags, the bold word will be rendered in Times New Roman font style even I set up the text block textinfo font name as Arial.
Please try using the following code snippet to accomplish your requirment.
[C#]
//Instantiate a pdf document Pdf pdf1 = new Pdf(); //Create a section in the pdf document Aspose.Pdf.Section sec1 = pdf1.Sections.Add();
//Create string variables with text containing html tags string s = "" + "This is a test for ARIAL </Font support " + " in Text paragraph. ";
string s2 = "
This is a test for" + " Verdana in text paragraph.
";
//Create text paragraphs containing HTML text Text t1 = new Text(s); t1.IsHtmlTagSupported = true; Text t2 = new Text(s2); t2.IsHtmlTagSupported = true;
//Add the text paragraphs containing HTML text to the section sec1.Paragraphs.Add(t1); sec1.Paragraphs.Add(t2);
//Save the pdf document pdf1.Save("d:/pdftest/TestHtml.pdf");