Forum Bugs

Upgrade to Prince 12 - blank page on certain book sizes

daneren2005
I was able to reproduce even on a super simple set of html. Run the latest snapshot of Prince on this will result in two pages being generated instead of only one. This is for some non-US customers that are converting mm into inches since we don't support them specifying the sizes in mm natively.

<!DOCTYPE html><html class="linux chrome chrome79 webkit webkit5"><head><style>@page { margin: 0px; prince-jpeg-quality: 100%;}@page dim85039x119291 { size: 8.50394in 11.92912in; }div.dim85039x119291 { page: dim85039x119291 }@prince-pdf {prince-filter-resolution: 400dpi}</style></head>

	<body class="productionOutput"><div class="contentProduction dim85039x119291" style="width: 816.378px; height: 1145.2px;"></div></body></html>



I can upload some more complex html that has images and crap on the page + page breaks between multiple pages, but figured this should be good enough since it causes it without any extra complications. This is running on the Ubunutu 16.04 download for the prince-20191023 snapshot.

Edited by daneren2005

markbrown
Hi,

We've made some changes to fragmentation which mean that the div, which is slightly larger than the available area, continues onto the second page for a very short space. You can avoid this by making sure the div is slightly shorter, e.g., make the height 1145.19px.

(We do allow for a small amount of wiggle room when fitting things in, but it is not quite enough in this case.)

Mark

Edited by markbrown

daneren2005
Alright that makes sense. Is there any way to get `page-break-inside: avoid` to work in this case? I am fine with working around this right now, but I worry that this is going to crop up again if another measurement is rounded by the browser to be off by 1/10th of a pixel. I only have so much control over this since that height of 1145.2px is not what I passed to the browser, it is just what it rounded it to.
markbrown
'page-break-inside: avoid' won't help here, as blocks will still fragment if larger than a page. We don't fragment absolutely positioned elements, so maybe a better workaround can be found using absolute positioning?

Mark