Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page break control - revisited

Status
Not open for further replies.

OsakaWebbie

Programmer
Feb 11, 2003
628
JP
For background on this issue, see thread215-1220895. Ever since that thread, several times a week, I have been manually editing multi-page handouts with a special "edit" functionality I wrote - first I view the Print Preview, then open my edit screen and manually adding page/column breaks and blank lines, go back to Print Preview to see how the following pages flow, edit some more, etc. There has to be a better way!

Now that IE7 and FF3 are out, I had renewed hope that the value of "avoid" for CSS properties of page-break-before/inside/after would be honored by newer browsers (especially FF, as it is my favorite, and implements a multi-column layout I often use for this content). But alas, it would appear that nothing has changed - only Opera seems to give a hoot about controlling this aspect of printing. And it still amazes me that there are lots of tutorial pages about CSS that talk of the page-break properties as if they were fully supported. Have they tested what they are teaching?

Anyway, the reason I'm writing is to ask again if there is another clever solution. My content is quite dynamic, from a database of songs, with varying amounts of info and in varying font sizes and such. I want to prevent any given phrase or verse of a song to be split between pages (or even worse, a title on one page and the lyrics on the next). Here is a demo page (just a single hymn repeated, a silly but effective example) with code that works in Opera but not in FF or IE, so you can see the issue. Does anyone have any creative ideas of how I could format such content so that it keeps the sections together, taking a whole section to the next page if it doesn't fit on the current one? I can predefine the paper size and margins if necessary, if that would help in making, for example, some sort of Javascript routine that ran through the content and calculated what fits on each page somehow. It's been two years since I last stumped the forum with this one - any new ideas out there?
 
I suggest yo9u do this server-side, and deliver PDFs to the client when you want to do the print. There are many of server-side solutions that could do this I reckon.

Cheers,
Jeff

[tt]Jeff's Blog [!]@[/!] CodeRambler
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top