You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for creating a great library. However, while testing table creation, I discovered that in the case of long tables, the cells appear to be cut off in the middle when the page breaks. I would like to inquire if there is a way to resolve this issue.
Here is a simple test code to reproduce the issue.
val landscapeA4 =PDRectangle(PDRectangle.A4.height, PDRectangle.A4.width)
val pageSet =PLPageSet(landscapeA4).setMargin(40f)
val r10 =FontSpec(PreloadFont.REGULAR, 10f)
val r14b =FontSpec(PreloadFont.REGULAR, 10f)
val aPadding =PaddingSpec(2f)
val aTable =PLTable.createWithEvenlySizedColumns(4)
aTable.setHeaderRowCount(1)
aTable.setMargin(10f)
// Add header rowval aHeaderRow = aTable.addAndReturnRow(
PLTableCell(PLText("No", r14b).setPadding(aPadding)),
PLTableCell(PLText("B", r14b).setPadding(aPadding)),
PLTableCell(PLText("C", r14b).setPadding(aPadding)),
PLTableCell(PLText("Page Break", r14b).setPadding(aPadding)),
)
aHeaderRow.setFillColor(PLColor.GRAY)
val row =listOf("column B", "column C", "1234567890\npage break test page break test page break test page break test page break test page break test page break test page break test")
for (i in0..32) {
aTable.addRow(
PLTableCell(PLText(i.toString(), r10).setPadding(aPadding)),
PLTableCell(PLText(row[0], r10).setPadding(aPadding)),
PLTableCell(PLText(row[1], r10).setPadding(aPadding)),
PLTableCell(PLText(row[2], r10).setPadding(aPadding)),
)
}
EPLTableGridType.FULL.applyGridToTable(aTable, BorderStyleSpec(PLColor.BLACK, 1f))
pageSet.addElement(aTable)
val pageLayout =PageLayoutPDF()
pageLayout.addPageSet(pageSet)
pageLayout.renderTo(File("page-break-sample.pdf"))
You can see that cell 7 is cut off in the middle as the page breaks.
The result I want is for row 7 to be written on the next page.
I would greatly appreciate it if you could provide a solution.
The text was updated successfully, but these errors were encountered:
Hi @walter-chequer, thanks for reaching out to me.
Indeed there should be an easy way to remedy this issue.
By adding .setVertSplittable (false) to a PLText you can avoid the page break. See also #30
Thank you for creating a great library. However, while testing table creation, I discovered that in the case of long tables, the cells appear to be cut off in the middle when the page breaks. I would like to inquire if there is a way to resolve this issue.
Here is a simple test code to reproduce the issue.
You can see that cell 7 is cut off in the middle as the page breaks.

The result I want is for row 7 to be written on the next page.
I would greatly appreciate it if you could provide a solution.
The text was updated successfully, but these errors were encountered: