Replies: 1 comment
-
if pdf.will_page_break(line_height):
render_table_header()
multiplier = len(pdf.multi_cell(pdf.epw * 0.8, row["article_description"], split_only=True)) Here you're checking if a single line would trigger a page break. The following version makes sure that you're checking for a potential page break with the actual height of the next row. multiplier = len(pdf.multi_cell(pdf.epw * 0.8, row["article_description"], split_only=True))
if pdf.will_page_break(line_height * multiplier):
pdf.add_page()
render_table_header() |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi fpdf2 team,
I am working hard to create a pdf generator and am stuck on the table. I need a multi_cell in one column and want the rest of the cell to adjust to it. I tried calculating the height needed by using the split_only attribute, but I still think I am doing something wrong there. Do you have an example of a table with repeating headers and a column which takes multi_cell data?
I got it to work if anyone wants to do something similar:
Beta Was this translation helpful? Give feedback.
All reactions