【发布时间】:2018-05-29 18:51:13
【问题描述】:
我在 .net 中使用 iTextSharp 使用以下代码
PdfPTable Header2 = new PdfPTable(2);
Header2.DefaultCell.Padding = 4;
Header2.WidthPercentage = 90;
Phrase pp4 = new Phrase();
pp4.Add(new Chunk(" Text of the first line\n", FontFactory.GetFont("Arial", 17, iTextSharp.text.Font.BOLD, iTextSharp.text.Color.BLACK)));
pp4.Add(new Chunk(" Text of the second line", FontFactory.GetFont("Arial", 15, iTextSharp.text.Font.ITALIC, iTextSharp.text.Color.BLACK)));
PdfPCell hcell3 = new PdfPCell(new Phrase(pp4));
hcell3.HorizontalAlignment = Element.ALIGN_LEFT;
hcell3.VerticalAlignment = Element.ALIGN_TOP;
hcell3.BorderColor = iTextSharp.text.Color.BLACK;
hcell3.BackgroundColor = new iTextSharp.text.Color(255, 255, 255);
Header2.AddCell(hcell3);
输出显示的文本在各行中彼此非常接近。我需要在两条线之间放置一些垂直空间。 如何在上面的代码中实现这一点?
【问题讨论】:
标签: c# .net itext pdf-generation