We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Append text in paragraph in C# using Aspose.PDF for .NET

Hi, I posted a question on stackoverflow regarding my issue here:


but may be I will get better luck in this forums. Please reply if any interrogations.


Thanks for using our products.

I have tested the scenario while using the following simple code with Aspose.Pdf for .NET 7.7.0 and as per my observations, Italic text is properly appearing and the whole string is in H1 formatting. Please note that when using IsHtmlTagSupported, it’s recommended to specify the text formatting (Bold, FontSize etc) using HTML Tags.


pdf1 = new Aspose.Pdf.Generator.Pdf();<o:p></o:p>

Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add();

Text title = new Text("

What a nice italic freaking title


var info = new TextInfo();

info.FontSize = 12;

//info.IsTrueTypeFontBold = true;

title.TextInfo = info;

title.IsHtmlTagSupported = true;



Furthermore, a Text paragraph can have one or more Segment object and you can specify different formatting for each segment. In order to fulfill your requirement, you may try using the following code snippet


Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf();

Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add();

Text title = new Text("What a nice");

var info = new TextInfo();

info.FontSize = 12;

info.IsTrueTypeFontBold = true;

title.TextInfo = info;

Segment segment2 = new Segment(" italic ");

// set the formatting of segment2 as Italic

segment2.TextInfo.IsTrueTypeFontItalic = true;

// add segment2 to segments collection of text object


Segment segment3 = new Segment(" freaking title ");

// add segment3 to segments collection of text object

segment3.TextInfo.IsTrueTypeFontBold = true;



// save the output document


For your reference, I have also attached the resultant PDF files generated with above code snippets. In the event of any further query, please feel free to contact. We are sorry for this inconvenience.