Question

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.

Was it helpful?

Solution

Try the following lines:

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

paragraph.AddFormattedText("Text in Bold Style", TextFormat.Bold); 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top