在我的C# windows窗体应用程序中,我使用了以下代码。它工作得很好。但我需要为这一段添加行距。
var linkFont = FontFactory.GetFont(FontFactory.HELVETICA, 13, iTextSharp.text.Font.UNDERLINE, BaseColor.BLUE);
List<Anchor> anchor = new List<Anchor>();
foreach (string tName in templateName)
{
Anchor anch = new Anchor(tName, linkFont);
anch.Reference = "#" + tName;
anchor.Add(anch);
}
Paragraph templateData = new Paragraph();
templateData.Alignment = Element.ALIGN_LEFT;
for (int z = 0; z < anchor.Count; z++)
{
templateData.Add(anchor[z]);
templateData.Add(" , ");
}
此代码的输出如下所示。Output of above code
如果我使用下面的代码,没有什么变化。
Paragraph templateData = new Paragraph();
templateData.Alignment = Element.ALIGN_LEFT;
templateData .SetLeading(15, 1);
如何解决此问题并为本段添加行距?
谢谢
发布于 2016-06-14 16:01:38
在以下位置更改Y
的值:
templateData.SetLeading(15, 10); //'1' to '10' or whatever you want
https://stackoverflow.com/questions/37806146
复制相似问题