从这个回购
var hr = doc.AddStyle("HorizontalRule", "Normal");
var hrBorder = new Border();
hrBorder.Width = "1pt";
hrBorder.Color = Colors.DarkGray;
hr.ParagraphFormat.Borders.Bottom = hrBorder;
hr.ParagraphFormat.LineSpacing = 0;
hr.ParagraphFormat.SpaceBefore = 15;
Run Code Online (Sandbox Code Playgroud)
游戏迟到了,但这里是一个附加到现有段落格式的示例,而不是像上面的答案那样覆盖,保留已经定义的格式:
Paragraph p = new Paragraph();
p.Format.Alignment = ParagraphAlignment.Center;
//...any other formats needed
p.Format.Borders.Bottom = new Border() { Width = "1pt", Color = Colors.DarkGray };
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6502 次 |
| 最近记录: |