【发布时间】:2019-03-27 08:57:02
【问题描述】:
我正在使用 iTextSharp 创建 pdf。
是否可以在pdfptable中的行之间提供空格?
【问题讨论】:
标签: itextsharp
我正在使用 iTextSharp 创建 pdf。
是否可以在pdfptable中的行之间提供空格?
【问题讨论】:
标签: itextsharp
您需要使用表格事件来做到这一点。
Java 示例:http://itextpdf.com/examples/iia.php?id=95
C# 示例:http://kuujinbo.info/iTextInAction2Ed/index.aspx?ch=Chapter05&ex=PressPreviews
请注意,我假设您希望单元格间距(而不是单元格填充)类似于您在此处看到的:http://examples.itextpdf.com/results/part1/chapter05/press_previews.pdf
【讨论】:
您可以像这样添加一个固定跨度、无边框和换行短语的单元格:
PdfPCell blankRow = new PdfPCell(new Phrase("\n"));
blankRow.setFixedHeight(5f);
blankRow.setColspan(4);
blankRow.setBorder(Rectangle.NO_BORDER);
【讨论】: