View Full Version : HTML page break
t.osberger
07-02-2006, 05:18 PM
Hello!
I am looking for a simple way of inserting a page-break command into my HTML pages to create a break for print/print preview. Sever of our document outputs are to long to fit on one printed page. If you have any suggestions, I would sure appreciate the help.
HTML is not ideal for printing. If you have information that is likely to require printing, you should provide a dedicated document for the purpose, perhaps in PDF or PostScript format.
djr33
07-02-2006, 10:25 PM
There is a specific character that is sent to the printer to signify a page break.
In ascii code, numbers represent characters, like 97 means (lowercase) a.
The "real" characters start at 32, and the ones before that are weird, and almost entirely outdated, system characters. A few of those do include printer functions, like page feed (wrong term, but I can't think right now... where it moves the paper forward), and page break, I believe.
Ideally, you could just embed the character in the html, and be done with it.
For example, a should be an "a". So... look up the character that represents page break, embed that where you'd like, kinda like a <br> tag.
Ideally, it wouldn't do anything to your document in the browser, and would only be noticed by the printer.
However, this is just a guess, and I wouldn't count on it working well, or at all, but might be worth at least looking into.
www.lookuptables.com will give you an ascii list... there are more available.
It looks like character 12 is what you're looking for... see if that helps.
(Also note that there is an "html" column in all columns except the first... so those may not be valid in html at all. Perhaps that's good, though, and they'll only be noticed by the printer.)
And, again, I'm just guessing, so don't be surprised if it doesn't do anything.
Clearly, the easiest solution is just to add whitespace to the pages; the browser will print what it sees.
And, yes, Twey is right here... html isn't the right language if you want to control things like printing, etc.
the ones before that are weird, and almost entirely outdated, system characters.Windows doesn't like to let on, but they're used quite frequently behind the scenes. :)
djr33
07-02-2006, 11:33 PM
Right, but they used to be used more for things that people were more involved in. I'm sure they're still used some, but the need for them has grown to be less, at least according to what I've heard.
the need for them has grown to be lessNot at all. As I said, they're still used fairly extensively behind the scenes. They're not as visible as they used to be, but they're certainly still necessary.
BLiZZaRD
07-04-2006, 11:42 PM
Couldn't the OP make a page for printing, and one for showing on the site?
Then add this to the site page:
<link rel=alternate media=print href="http://www.site.com/path/to/pagetoprint.doc">
From what I understand (although it may not be cross browser supported) when you click the print button or select print from the drop down menus it will print the other document instead?
The "printer friendly" versions... I have seen this a lot on many sites.
From what I understand (although it may not be cross browser supported) when you click the print button or select print from the drop down menus it will print the other document instead?Not only is it not cross-browser, it also doesn't always work in IE6, the browser in which it's supposed to. Avoid at all costs. :)
BLiZZaRD
07-04-2006, 11:47 PM
So is there one that DOES work? Seems like such a nice little feature.
Nope. All you can do is specify a print stylesheet, and/or link people to a seperate file.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.