Break sections in pdf

Im creating a pdf with the following code
return PDFRenderer(page_size='A4', margins=0, filename='cv.pdf').render_form('pdfs.default', email=email, ...).

The pdf.defaults is a form which is dynamic filled with sections of content. A section consists out of a heading, subtitle and a description.
I want a page filled with section and if the whole sections doesn’t fit, it should go to the next page.

The situation now is that the heading sticks to the end of page 1 and the subheading and description are on page 2

Wrapping the sections in a grid isn’t working

Is there some sort of break that I can add via css to the gridpanels that are wrapping the sections?

You might want to have a look at the PageBreak component in Anvil Extras.

2 Likes

@owen.campbell that’s a good start, but how would you calculate when a page break should be added?

1 Like