Fixing Page breaks in PDF created from a list page

Re: [gkornbluth] Fixing Page breaks in PDF created from a list page

By robin - March 25, 2011

Hi Jerry,

The pdf creator generally respects css print properties. The following code might do the trick. It tells the browser not to page break in the middle of a table row.

This goes in the HTML head
<style>
tr {page-break-inside:avoid}
</style>


Please let me know if you have any further problem.

Robin
Robin
Programmer
interactivetools.com

Re: [robin] Fixing Page breaks in PDF created from a list page

Thanks Robin,

I'll give it a try and let you know.

Jerry
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] Fixing Page breaks in PDF created from a list page

By gkornbluth - March 25, 2011 - edited: March 25, 2011

Hi Robin,

Sorry, but that didn't work. I've even tried style="page-break-inside:avoid" in the <tr> tag.

I found this http://www.w3schools.com/CSS/pr_print_pagebi.asp which says that opera is the only browser that will support break-inside:avoid.

Do you have any other idea I might try?

Thanks,

Jerry
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] Fixing Page breaks in PDF created from a list page

By robin - March 28, 2011

Hey Jerry,

Too bad that didn't work for you. I've been talking to Damon about this problem. Tables tend to page break badly. In the past people have either switched from table layout which works a lot better for print.

Another thing that could work is to break the table or use the css "page-break-after:always" after a certian number of rows. That is tricky with variable length content however.

Hope that helps,
Robin
Robin
Programmer
interactivetools.com

Re: [robin] Fixing Page breaks in PDF created from a list page

Thanks Robin,

I agree about the variable length content issue.

I'll play around with a CSS approach to replace the table and see if that helps any.

Any suggestions appreciated.

Jerry
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php