We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

No Pagebreak if cell height in Table too large?

Hello,

i create a page and add content to it. When i am near the page end and add a large table cell to it (with setfixedheight), instead of starting a new page because the cell does not fit in the actual page, the large cell is rendered in the page and overlaps with the footer.
Can you help me please?

@schiepe

Thanks for contacting support.

Could you please share the complete sample code snippet along with generated PDF document with us. We will test the scenario in our environment and address it accordingly.

Hello,

here are code snippets we use, i hope it helps:

20190110_Customer_12345.pdf (3.3 MB)

Document pdfDocument = new Document();
Page pdfPage = pdfDocument.getPages().add();
//Here, content is written to the page so that the content fills 3/4 of the page, so that the following textbox does not fit to //the current page

//Now the textbox
Table table = new Table(“510”);
Row currentRow = table.getRows().add();

TextBoxField textBoxField = new TextBoxField(pdfDocument)
textBoxField .setHeight(“340”)
currentRow.setFixedRowHeight(“340”)
textBoxField.setWidth(“510”)
textBoxField.setMultiLine(true);
textBoxField.setVerticalAlignment(VerticalAlignment.Top);
textBoxField.getDefaultAppearance().setFontSize(11);
textBoxField.getDefaultAppearance().setTextColor(new java.awt.Color(0, 0, 0));
textBoxField.getDefaultAppearance().setFontName(“BoschSansGlobal-Regular”);

Cell cell = new Cell();
cell.setMargin(new MarginInfo(0, 0, 0, 0));
cell.getParagraphs().add(textBoxField);
cell.setColSpan(1);
currentRow.getCells().add(cell);
pdfPage.getParagraphs().add(table);

@schiepe

Thanks for sharing code snippet.

We have tested the scenario in our environment using your shared code snippet and were unable to replicate the issue which you have mentioned. Your code snippet generated attached PDF document where overlapping footer issue was not present.

Table.pdf (2.1 KB)

Furthermore, would you please make sure that you are using latest version of the API in your environment. Also, please try specifying margins for page and header/footer of the page accordingly. In case issue still persists, please share complete sample code snippet with which issue is reproducible. We will test the scenario in our environment and address it accordingly.