Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Oct 2003
    Location
    Ukraine
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to print multiple html documents ?

    Hi,

    I have set of html documents on the server (in the DB) and I need to print them all as the one print job.
    (my question is not about server side programming)
    I tried to merge documents and make one page of multiple html docs and
    and request them from a window to call window.print() then.
    IE and NS browsers show such a 'document' but since it is a one window
    background gets same for all documents.
    Then I tried to put them into separate frames and iframes but all didn't work.

    How to do it ?

    Thanks,


    Slava

  • #2
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    what activates the print statement? is it a link? i.e "Print XYZ"

    FYI: to my knowledge you CAN do this fairly easily. it requires a javascript code (which i think i have somewhere, lemme go look)

    bb
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #3
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    okay. in all honesty my way wont work for you.

    i have a link on one page that prints another URL... but for multiple documents at once you'd need a JS script... which could be handy for me as well. i hope someone gives you one.

    heres what i did:
    on the url "linecard.html", i have a link called

    Code:
    <a href="print_linecard.html" onClick="window.print();return false;"
    and in the head i have

    Code:
    <link rel=alternate media=print href="print_linecard.html">
    basically i think you'll need a javascript that will take multiple arguments at once, with an activation statement like
    ... printMultiple('link1.html', 'link2.html', 'link3.html', etc)
    Last edited by canadianjameson; 07-10-2004 at 07:04 AM. Reason: ideas
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #4
    New Coder
    Join Date
    Oct 2003
    Location
    Ukraine
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post How to get correct height of the document inside of the IFRAME ?

    Hi,

    I decided to put each of the urls to html pages (that I need to print) to the separate IFRAMEs. So I have now complete document containing multiple pages inside, for printing.
    But now I need to determine correct size of the document in each iframe to resize them (iframes) to height/width of the document.
    Code:
    <html>
    <head>
    <script language="JavaScript">
    function SetFullSize()
    {
     var frame1 = window.document.getElementById("frame1");
     //window.document.body.style.height = frame1.height + frame2.height;
     frame1.height = frame1.document.body.offsetHeight;
     frame1.width = frame1.document.body.offsetWidth;
    }
    </script>
    </head>
    <body onclick="SetFullSize();">
    <iframe name="frame1" id="frame1" src="http://www.mail.ru" frameborder="0">
    </body>
    </html>
    I left only one IFRAME to shorten code here.
    I tested it in the IE 6.0.
    When I click (to run SetFullSize) my IFRAME(s) get correct width, but height is about half less and I see vertical scroll bars on them.

    How to get correct height of the document inside of the IFRAME ?

    Thanks

    Slava
    Last edited by SlavaTT; 07-10-2004 at 11:12 PM.

  • #5
    New Coder
    Join Date
    Oct 2003
    Location
    Ukraine
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    I've found my bug, after reading article I 'googled'.
    Sorry for asking.

    Slava


  •  

    Posting Permissions

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