views:

29

answers:

1

I have a web page containing a form that currently print comfortably in two pages. The second page has almost half a page of white space that I would like to be able to fill with a text box. Is this possible at all?

A: 

In short: no. For you, the web page prints out in two physical pages. For someone that has the font size cranked way up, it could be 3 pages. Or maybe they're printing on A4 instead of letter (or vice versa). Or maybe they're on Linux, OS X, or Windows 2k and have different fonts loaded than you do. Are all those stupid headers/footers turned on or off? What's the default margin size? Throw in browser differences and you really have no chance of getting a consistent printing experience.

The only thing CSS offers that is related to printing is page breaks, but even there, you can't prevent page breaks, only insert them before or after a particular element.

noah
Would it not be possible to use JS to ask the browser how high the printable area would be? Then you could could figure out what the the size of the currently displayed body would be, and if there is more than a certain height left for whatever is the left page you would insert an extra element into the page?
Sam
@Sam I don't think so. Again, the browser has no concept of a page with respect to printing.
noah