Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MigraDoc - Bold certain text in a paragraph

In MigraDoc, if I have a paragraph, how can I only bold some text in the paragraph, not the entire paragraph.

Edit: Below is the typical code I would use to add a bolded paragraph.

var paragraph = section.AddParagraph("This text");
paragraph.Format.Font.Bold = true;

I can't just add separate paragraphs splitting the text, because MigraDoc puts space between the paragraphs.

like image 543
contactmatt Avatar asked Sep 13 '12 21:09

contactmatt


1 Answers

Try the following lines:

var paragraph = section.AddParagraph("This text"); 

paragraph.AddFormattedText("Text in Bold Style", TextFormat.Bold); 
like image 141
Victor Avatar answered Oct 28 '22 01:10

Victor