printing external html page

Discussion in 'Javascript' started by dm, Feb 12, 2004.

  1. dm

    dm Guest

    I was wondering if anyone knew a way to print a page, other than the one
    displayed. I don't want the other page to display at all. I was thinking
    of placing a button on the page that is being displayed, which will pull
    up the print dialog to print another page. Is that possible? Thanks in
    advance for any help.

    dm, Feb 12, 2004
    1. Advertisements

  2. I think the solution here is to open the newwindow =;
    but outside the screens view i.e set the popup to open in a specific
    location, then newwindow.print(); then newwindow.close();

    I think I have seen this done before, but don't forget about these peps
    without JS who won't be able to do this in this way.

    Stuart Palmer, Feb 12, 2004
    1. Advertisements

  3. dm

    dm Guest

    Thanks for replying,
    I have figured out a way in the meantime similar to your idea with some
    help from a post somewhere else. I have a layer containing an iframe
    with the text positioned off screen. I made a button in the active html
    that that executes code to put focus on the frame and print it. Before
    that I have it test the type of browser to determine which code to
    execute to print the page (since there seem to differences between the
    browsers). Works like a charm now. Thanks.

    dm, Feb 12, 2004
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.