@Override
public void process(int level, Node node, InvocationContext context) {
TableNode tableNode = (TableNode) node;
List<TableColumnNode> tableNodeColumns = tableNode.getColumns();
PdfPTable table = new PdfPTable(tableNodeColumns.size());
for (PdfPTableEvent tableEvent : tableEvents) {
table.setTableEvent(tableEvent);
}
context.pushTable(new TableInfos(table, tableNodeColumns));
context.processChildren(level, node);
context.popTable();
KeyValues kvs = context.iTextContext().keyValues();
Float spacingBefore = kvs.<Float>getNullable(TABLE_SPACING_BEFORE).or(5f);
Float spacingAfter = kvs.<Float>getNullable(TABLE_SPACING_AFTER).or(5f);
table.setSpacingBefore(spacingBefore);
table.setSpacingAfter(spacingAfter);
applyAttributes(context, table);
context.append(table);
}
TableNodeProcessor.java 文件源码
java
阅读 18
收藏 0
点赞 0
评论 0
项目:gutenberg
作者:
评论列表
文章目录