Results 1 to 10 of 10

Thread: HTML page break

  1. #1
    Join Date
    Mar 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool HTML page break

    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.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    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.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    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.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    the need for them has grown to be less
    Not 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.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #7
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    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.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  8. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    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.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  9. #9
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    So is there one that DOES work? Seems like such a nice little feature.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  10. #10
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Nope. All you can do is specify a print stylesheet, and/or link people to a seperate file.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •