Forum How do I...?

Detect overflow

have
Is there any way at all to detect the overflow of elements on a page, or content in an element.

Let's say I want four DIVs on a page - but with flexible heights. If they are too large, the last element is flowed to the next page.

Can I detect this? Like with CSS (give it a red border) - or some other way?

I guess I can try to keep track on the number of pages. If the generated PDF is 54 pages and it should only be 53 pages, something is wrong.

However, this is kind of a last resort ...
mikeday
There is "float: prince-top-if-necessary", which will move an element to the top of the next page if it cannot fit on the current page. It might almost be what you need. :)
have
Sounds interesting! I'll give it a try, thanks.