This is an archived forum post. The information may be outdated. Contact us if you have any questions.

getting the elements height on the printed page

kreut wrote on 2012-09-02:
Hello!

I've been trying to figure out a way to get my "float: right" images to not break across pages. I've read up in this forum that the pdfcrowd algorithm doesn't (yet?) support this feature. I'd love to hear what approaches people are taking, as I imagine that I'm not the only one who is facing this issue!

And, to the pdfcrowd creators: it would be fantastic if there could be a way for us to add a class to any element (paragraph, table, image, etc.) that we don't want broken across pages. Is this at all within the realm of possibility?

Thanks so much,

Eric
support wrote on 2012-09-05:
Eric,

it is possible to use the "page-break-inside:avoid" css rule. This works on block level elements so for instance to avoid splitting a table cell between two pages define this:
td, tr { page-break-inside: avoid }

Unfortunately, the result of using this rule with floating elements is unpredictable.
kreut wrote on 2012-09-07:
Thanks so much for the response! I saw the page-break-inside: avoid solution on another post. However, I fear that floated images are exactly what I need to use it for and because of this, it's not a viable solution. Perhaps a more universal solution will be available in the future.

-Eric