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

page-break-inside

heynow wrote on 2011-05-23:
Hi There,

Great product! Just discovered it, did some light testing and things look great! One feature I'd really really like to see is css page-break-inside implementation. When creating reports it would be nice to prevent certain sections from breaking onto a new page (Unless they're too big they have to fit onto two pages)

I mention this because in a report I'm working with the vertical sizing is dynamic so sometimes the PDF will display the header of a section but all the content will be on the next page. I know that page-break-before and page-break-after works with pdfcrowd but with smaller report chucks it creates a lot of excess whitespace.

Any thoughts on this?

Thanks!
support wrote on 2011-05-24:
Hi, thanks for the feedback!

You are right that the page-break-inside property would be useful. We can't promise that we will implement it but we may look into it.

A workaround for dynamically generated pages is to keep track of the height of the current page and to insert page-break-after directives accordingly.

Another option is to figure out the height of individual html elements and inject the page-break-after property from javascript on onLoad event.
heynow wrote on 2011-05-25:
Yeah, I wasn't sure using the web-kit engine how that would work. I'll see what I can do with javascript. Everything else is rad!

Thanks!
conciergelive wrote on 2011-11-09:
Couldn't agree more, this would be a VERY nice feature to have. Without this, it really kind of makes using this service pointless for dynamic content that is multiple pages.
support wrote on 2011-11-11:
Hi,

Here is a related discussion thread that may interest you: https://pdfcrowd.com/forum/archive/read/?3,592

It shows how to prevent a page break inside a table cell.
support wrote on 2012-05-20:
Update: "page-break-inside:avoid" is supported now
raceoffice wrote on 2012-06-27:
Hi,

I tried your product and I really like it! Unfortunately I still nit get the "page-break-inside:avoid" running. I am using convertHtml() and the HTML input mainly constits of tables. Inside the tables are several <tbody> sections. When trying to use "page-break-inside:avoid" for the tbody sections it doesn't works. Do you have any hints for me? Maybe also a work around, because I need this thing running for a customer by mid of next week!

Thanks in advance,
Guido
support wrote on 2012-06-27:
Quick tip: using "page-break-inside:avoid" should work for <td> and <th>:
td, th { page-break-inside: avoid; }


I'm not sure about <tbody> but most likely this is not supported at the moment.
emitta04@gmail.com wrote on 2020-12-16:
page-break-inside:auto or page-break-inside:always is not supporting in our pdf when we use pdfcrowd api
support wrote on 2020-12-16:
Hi,

These CSS properties should work, please send us a sample HTML that demonstrates the issue to pdfcrowd@support.com and we will look into it.