We are currently using Aspose.PDF 20.9 for java. We faced a problem with having a header cell with rowspan in the table. The first 2 rows should be repeated on all pages. However, setRepeatingRowsCount(2) method splits that cell into 2 cells.
Below you can find an example
Document doc = new Document();
//Create the section in the PDF object
Page page = doc.getPages().add();
//Instantiate a table object
Table tab = new Table();
//Add the table in paragraphs collection of the desired section
page.getParagraphs().add(tab);
//Set default cell border using BorderInfo object
tab.setDefaultCellBorder(new com.aspose.pdf.BorderInfo(com.aspose.pdf.BorderSide.All, 0.1F));
//Set table border using another customized BorderInfo object
tab.setBorder(new com.aspose.pdf.BorderInfo(com.aspose.pdf.BorderSide.All, 1F));
//Create rows in the table and then cells in the rows
Row row1 = tab.getRows().add();
Cell col1 = row1.getCells().add("header cell with rowspan");
col1.setRowSpan(2);
row1.getCells().add("header upper cell");
Row row2 = tab.getRows().add();
row2.getCells().add("header lower cell");
tab.setRepeatingRowsCount(2);
for (int row_count = 1; row_count < 500; row_count++) {
Row row = tab.getRows().add();
row.getCells().add("Column (" + row_count + ", 1)");
row.getCells().add("Column (" + row_count + ", 2)");
}
//Save the PDF
doc.save(dataDir + "ResultantFile.pdf");
Attached you can find the resulting pdf. and 2 screenshots
ResultantFile.pdf (62.5 KB)
pic2.png (59.2 KB)
pic1.png (51.8 KB)