My question: where to I insert any HTML code to instruct a PDF-printer where to (avoid a) page break? Is it with a HTML-element, and if so - how do I target the div that I want to avoid from page-breaking?
Good question. Since WeWeb doesn’t render raw HTML directly, it’s not possible to inject classic print-specific HTML or CSS instructions like page-break-inside: avoid in the visual editor itself.
If you’re using a PDF service like PDF.co that reads those instructions, the limitation is that WeWeb doesn’t expose the raw markup where you could manually add tags or styles (like <div style="page-break-inside: avoid">...</div>).
That said, here are a couple of ideas you can try:
• Group content in a Container: Sometimes wrapping the content you want to keep together (like a table header and its rows) in a single Container element can help maintain layout integrity when exported as PDF.
• Use CSS classes if your PDF engine supports external stylesheets: If you’re exporting HTML from WeWeb before sending it to PDF.co, you might be able to apply custom styles like:
Then apply that class to the relevant wrapper div , but this would only be possible if you’re exporting HTML and have control before the PDF generation.
• Post-processing workaround: If you’re generating the PDF outside WeWeb (e.g. via a backend), you could manipulate the HTML there before sending it to the PDF service and inject any needed styles or tags.
On a positive note, I can confirm that a HTML-codeblock DOES make PDF.co understand where to break. That what got my hopes up to make PDF.co also understand when NOT to break. But the challenge is that I need some parts of dynamic lists within another dynamic list to not break, so I guess it’s not reasonable to expect from PDF.co to make a correct interpration on what containers not to break.
Question: would you say this might be something for Weweb to develop - to enable this use case of a PDF-template ?