Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2004
    Posts
    285
    Provided Answers: 1

    Unanswered: Print a different webpage to the one been viewed

    Good day,

    I would like to know if anyone knows how to send a different page to the printer when one wants to print a page. I can create a printer friendly page and open that when the users wants to print and then they can print that but I would prefer just to have a button or something and when they click it, it will print a formatted page. I current;y have a directory listing of people in our company with names, email addresses, contact numbers speed dials and so on and only want to print the persons name and speed dial, the rest I am not interested in. As I said, I can create a page that will open and that needs to be printed but it is not ideal as, well users are idiots for the most part, and will mess something up.

    Any help or ideas woul dbe greatly appreciated.

    Thanks in advance

  2. #2
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    I've never tried this, so I can't vouch for it, but you could try to create an IFrame, set it to height and width = 0 (to hide it), then load the page to be printed into the IFrame and use JavaScript's window.print() on that page in the IFrame to print it out.. a shot in the dark, but worth a try.
    That which does not kill me postpones the inevitable.

  3. #3
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    I was curious about this after I posted this, so I tried it out, and it does in fact work. You just have to remember that the window.print() call MUST come from the page loaded into the iframe.
    That which does not kill me postpones the inevitable.

Posting Permissions

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