Free Support Forum - aspose.com

Broken tables: bottom border + text on page break possible?

Hi,

I am currently building a PDF (via API, not XML) which contains a table that spans multiple pages. Rows are not separated by lines, but the table itself is surrounded by lines. If a pagebreak occurs, the table part on the current page should be finished by a top and a bottom line.

The table part on the next page does get its top line if I enable the repeated first row, but for the line at the bottom I did not find any solution... isn't this possible?

Another question regards the possibility of adding a title/footer to the table that indicates if the table is continued on the next page or not - is this possible?

Best regards,
Mathias Harbeck

Hello Mathias,

Thanks for using our products.

Can you please share the code snippet so that we can test the table span to multiple pages scenario at our end.

Regarding adding Title/Footer to the table, I am afraid this feature is currently not supported. For the sake of implementation I have logged this requirement as PDFNET-27320 in our issue tracking system under new features list. We will further look into the details of this requirement and see if we can implement this feature or not. Please be patient and spare us little time. We apologize for your inconvenience.

FYI, Currently Table class has a property named IsEmptyRowAtBottomShown which indicates that if the empty row at the bottom of the table be shown in the PDF.

Hello Nayyer,

thanks for your reply. I already tried IsEmptyRowAtBottomShown, but for my code it has no effect...

Here is the snippet you asked for:

//...
Table table = new Table(sec);
sec.getParagraphs().add(table);
table.setColumnWidths("8% 36% 28% 28%");
table.setDefaultCellBorder(new BorderInfo(BorderSide.None.getValue(), 0.1F));
table.setBorder(new BorderInfo(BorderSide.All.getValue(), 1F));
TextInfo tinfo = new TextInfo();
tinfo.setFontName("Helvetica");
tinfo.setFontSize(12);
table.setDefaultCellTextInfo(tinfo);
table.setIsFirstRowRepeated(true);
table.setIsEmptyRowAtBottomShown(true);
MarginInfo margin = new MarginInfo();
margin.setBottom(3);
margin.setTop(3);
margin.setLeft(5);
margin.setRight(5);
table.setDefaultCellPadding(margin);
Row row1 = table.getRows().add();
row1.setBackgroundColor(new Color((short) 153, (short) 153, (short) 153));
row1.getCells().add("Type");
row1.getCells().add("DMC");
row1.getCells().add("Techname");
row1.getCells().add("Infoname");
TextInfo tinfo2=(TextInfo)tinfo.clone();
tinfo2.setAlignment(AlignmentType.Center);
tinfo2.setFontName("Helvetica-Bold");
row1.setDefaultCellTextInfo(tinfo2);
for (...data...) {
Row row2 = table.getRows().add();
row2.getCells().add(...);
row2.getCells().add(...);
row2.getCells().add(...);
row2.getCells().add(...);
row2.setDefaultCellTextInfo(tinfo);
}

Best regards,
Mathias Harbeck

Hello Mathias,

Thanks for sharing the code snippet.

I have tested the scenario and I have observed that when table spans more than one page, the Bottom border is not being displayed (except for last page). I have logged this requirement under new features list in our issue tracking system as PDFJAVA-27351. We will further look into the details of this requirement and will keep you updated on the status of correction. Please be patient and spare us little time. We apologize for your inconvenience.

Besides this, I have observed that Table border is not properly being displayed when using Aspose.Pdf for Java 2.9.0 For the sake of correction, I have logged this problem as PDFJAVA-27350 in our issue tracking system. The feature used to work properly with v2.7.0 but I am afraid it's causing some issue in latest release version. Please be patient and spare us little time.

Your patience and comprehension is greatly appreciated in this regard.

The issues you have found earlier (filed as 27351 ;27350 ) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.