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
Hi, Hope you are all good.
I am encountering an issue with the dontBreakRows: true option in my implementation. Specifically, when a row with a top border is moved to the next page, the top border remains on the previous page rather than transferring to the new page with the row.
To address this issue, I have attempted a custom pageBreakBefore implementation. Despite this effort, the problem persists: while the row is correctly moved to the next page, the top border remains on the previous page.
Additionally, in my use case, where content is dynamic, I have experimented with a custom hLineWidth function to predict page breaks and set the border’s hLineWidth to 0. Unfortunately, this approach did not resolve the issue for all scenarios as the rows can change size/quantity.
Could you please confirm if this is a known issue or if there might be a misconfiguration on my part? Any insights or suggestions on how to resolve this would be greatly appreciated.
Thank you in advance
Playground example
var dd = {
content: [
{
style: 'tableExample',
table: {
headerRows: 1,
dontBreakRows: true,
keepWithHeaderRows: 1,
body: [
[{text: 'Header 1', style: 'tableHeader'}, { text: 'Header 2', style: 'tableHeader'}, {text: 'Header 3', style: 'tableHeader'}],
[
{text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'},
{text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'},
{text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'}
],
[
{border: [false, true, false, false], text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'},
{text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'},
{text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'}
]
],
},
layout: {
defaultBorder: false,
}
}]
}
Screenshot (from playground example)
The text was updated successfully, but these errors were encountered:
But what should be the correct outcome for this doc definition? I'd say the border should be drawn in the first and second page. The top border of the cell in the second page is the bottom border of the cell in the first page and pdfmake draws the border in both pages whenever there is a page break.
But what should be the correct outcome for this doc definition? I'd say the border should be drawn in the first and second page. The top border of the cell in the second page is the bottom border of the cell in the first page and pdfmake draws the border in both pages whenever there is a page break.
Thank you for your answer @fe-cj. Sorry about the delay, I was on leave.
Regarding the document definition, the expected behavior IMO is for the top border to be carried over to the next page. Since the border is specified as [false, TRUE, false, false] for the second row only, the top border should appear at the top of the cell on the subsequent page.
To provide more context, I’m generating a PDF where the top border serves as a "divider" between different sections. The issue arises when the entire content moves to the next page due to dontBreakRows: true, but the border remains on the previous page.
I hope this clarifies the situation. Please let me know if you need any further information or have additional questions!
Hi, Hope you are all good.
I am encountering an issue with the
dontBreakRows: true
option in my implementation. Specifically, when a row with a top border is moved to the next page, the top border remains on the previous page rather than transferring to the new page with the row.To address this issue, I have attempted a custom
pageBreakBefore
implementation. Despite this effort, the problem persists: while the row is correctly moved to the next page, the top border remains on the previous page.Additionally, in my use case, where content is dynamic, I have experimented with a custom
hLineWidth
function to predict page breaks and set the border’s hLineWidth
to 0. Unfortunately, this approach did not resolve the issue for all scenarios as the rows can change size/quantity.Could you please confirm if this is a known issue or if there might be a misconfiguration on my part? Any insights or suggestions on how to resolve this would be greatly appreciated.
Thank you in advance
Playground example
Screenshot (from playground example)
The text was updated successfully, but these errors were encountered: