con*_*att 19 c# pdfsharp migradoc
在MigraDoc中,如果我有一个段落,我怎么才能在段落中加粗一些文字,而不是整个段落.
编辑:下面是我用来添加粗体段落的典型代码.
var paragraph = section.AddParagraph("This text");
paragraph.Format.Font.Bold = true;
Run Code Online (Sandbox Code Playgroud)
我不能只添加拆分文本的单独段落,因为MigraDoc在段落之间放置了空格.
小智 27
请尝试以下行:
var paragraph = section.AddParagraph("This text");
paragraph.AddFormattedText("Text in Bold Style", TextFormat.Bold);
Run Code Online (Sandbox Code Playgroud)