简体   繁体   English

如何在itext7中extendLastCell()?

[英]How to extendLastCell() in itext7?

In itext5 you can call setExtendLastRow(true); 在itext5中,您可以调用setExtendLastRow(true);。 on a table. 在桌子上。 To have the last cell extend to the bottom of the page. 要使最后一个单元格延伸到页面底部。

I am trying to have my itext7 table extend to bottom of page, even though it is just empty space. 我正在尝试将itext7表扩展到页面底部,即使它只是空白空间。

I created a page border but it does not look as clean if the table's border spanned to the bottom of page. 我创建了页面边框,但是如果表的边框跨到页面底部,它看起来就不那么干净了。

Setting the height of the table does not work. 设置桌子的高度不起作用。 The height property gets set but seems to not effect the actually height on the pdf page. 设置height属性,但似乎不影响pdf页面上的实际高度。

The name of the method providing this behavior has changed in iText7. 提供此行为的方法的名称在iText7中已更改。

To extend the cells in the last row on every page, use 要扩展每页最后一行中的单元格,请使用

table.setExtendBottomRow(true);

To do the same for every page except the last one, use 要对除最后一页以外的所有页面执行相同操作,请使用

table.setExtendBottomRowOnSplit(true);

Please note that this API will be available from release 7.0.2 on, which is not far away. 请注意,此API将从不远的7.0.2版本开始可用。 This functionality is also already available in the latest SNAPSHOT version 最新的SNAPSHOT版本中也已经提供了此功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM