我在我的应用程序中使用iText。
我将向iText PDF生成器类发送一个数组集合。该数组集合有10个项目,现在,我想在一个表中显示这10个项目。
显示表格的条件是每页只显示5个项目,其余项目应转到下一页并在表格中显示。
float[] colsWidth = {0.5f,4f,1.4f,1.4f};
PdfPTable itemListTab = new PdfPTable(colsWidth);有什么建议吗?
发布于 2012-06-21 19:49:53
在迭代数组时,每隔五个元素,将表添加到文档中,开始一个新页面,并创建一个新表。
if (/* 5 elements */) {
// add your table to the document
document.add(itemListTab);
// create a new page
document.newPage();
// create a new table
itemListTab = new PdfPTable(colsWidth);
}https://stackoverflow.com/questions/11137117
复制相似问题