Forum Bugs

Getting Spurious page break, perhaps due to overflow hidden on images?

Christine
Using Prince 11.4

I'm getting page breaks in the middle of a table, when the table should fit on the page. I've tried using "page-break-inside: avoid" at table level and tbody level and "page-break-after: avoid" on the specific row where the page break is happening.

In the example PDF, the heading and the drawing should be on the same page. I believe its because the hidden overflow of the image is being used in the calculation of the content height when determining if the content will fit on the current page.

Many thanks for your help

  1. example.html.zip1.0 kB
    Example HTML
  2. example.pdf129.4 kB
    Example PDF
markbrown
We're not able to fragment images so in normal flow we do in fact use an image's height to determine whether it fits on the page, and we break if it doesn't. Unfortunately, this occurs even if the part that doesn't fit is hidden.

One way to work around this is to use absolute positioning of the image (that is, use 'position: absolute' on the image and 'position: relative' on the div that contains it), which should make the image overflow the page rather than force a page break. Please see attached.
  1. example2.html0.9 kB
    Example with img absolutely positioned

Edited by markbrown

Christine
Thank you for that - having a look now
Christine
Yes, all good, thank you.