Free Support Forum - aspose.com

Problems with rowspan

Hi,

I would like to use Aspose.PDF for Java for generating PDFs. So far I like Aspose.PDf, but I have a problem with rowspan in tables. I would like to use rowspan, but when I set it to 2 no row would be spanned, and to 3 only two rows are spanned. Furthermore the spanning starts at the cell under the cell with the defined rowspan. Do you have a solution for this problem?

Thanks!

Katrin

Hi Katrin,


Thanks for using our products.

Can you please share the code snippet and the output file being generated over your end, so that we can test the scenario at our end. We are sorry for this inconvenience.

Pdf pdf = new Pdf();
Section section = pdf.getSections().add();
Table table = new Table(section);
table.setColumnWidths(“100, 100, 100, 100”);
Row pdfRow;
Cell pdfCell;
for (int rowIdx = 0; rowIdx < 8; rowIdx++) {
pdfRow = table.getRows().add();
for (int colIdx = 0; colIdx < 4; colIdx++) {
pdfCell = pdfRow.getCells().add(“test”);
if(rowIdx == 2 && colIdx == 2){
pdfCell.setRowSpan(3);
}
BorderInfo borderInfo = new BorderInfo(BorderSide.All.getValue());
pdfCell.setBorder(borderInfo);
}
}
section.getParagraphs().add(table);
pdf.save(“C:\iText\Table.pdf”);

In row/cell 2, 2 the rowspan starts at row 3.

Hi Katrin,


I
have tested the scenario and I am able to reproduce the same problem. For the
sake of correction, I have logged it in our issue tracking system as
PDFJAVA-33177. We
will investigate this issue in details and will keep you updated on the status
of a correction.

We
apologize for your inconvenience.