views:

122

answers:

1

hi all

I have a rails app that creates quotations with information and images on that can be very different in size and the data they display.

Each quote contains many setions of varying sizes.

I need to find a way to auomatically put page breaks into the quote when printing so that none of th sections are cut into printing on 2 pages.

Any ideas or experience with this would be great

thanks alot rick

A: 

I think you are looking for the page-break-beforeand page-break-after CSS properties:

<br style='page-break-after: always'>

Check the documentation for caveats and notes.

Pekka
Pekkayes this is what i will use but i have to add this dynamically if a section will not fit on the current page, i can't just assin this to all sections as they would appear each on its own page. I have to work out the height of the section and if it will fit on the remaining space on the current page - if not put onto next page and so on..any ideas ?
richard moss
That is going to be difficult using HTML/CSS, because it is very hard to reliably find out the remaining space. Maybe you can work with a combination of ´<tables>´ with `page-break-after: avoid`?
Pekka