Forum How do I...?

Conditional page-break-before

matt_d_rat
I was wondering what would the best way to implement this.

I am writing a php application which produces PDFs for html verions of invoices generated in an online accounting system. I have been very impressed with PrinceXML so far, but was wondering whether it is possible to do a conditional page-break-before rule on an element if the content of the first page exceeds a certain percentage of the page. The reason being is the footer I want to break should either sit on a single page or on a seperate page in its entirety, not have its contents split up over the two.

Can someone recommend the best way to achieve this? Is this possible using the page media CSS rules?

Thank you for your help.
jim_albright
Does the documentation help?

http://www.princexml.com/doc/7.0/page-breaks/

Jim Albright
Wycliffe Bible Translators

mikeday
"page-break-inside: avoid" might be what you are looking for.
matt_d_rat
Hi, Thanks for your replies. Yes you were right using the page-break-before: avoid; I was able to achieve what I wanted. I just had to take a step back and think about the cases when I wanted it to break in order to choose the correct one.