[thelist] Printing a URL

bread_man breadilicious at hotmail.com
Wed Mar 27 10:02:01 CST 2002

Hi Sandra.

Most excellent.  Using that tag, I can now do what I need to do!  Thanks so
much for replying, I was about to give up.  What I have done is created a
page with a link that loads an identical page. When that page loads, it does
a window.print(), but I have added the <link rel=alternate media=print> tag
to specify alternate media!  I tested it with a word doc and another html
page, like yahoo.com and it works like a charm!  It didn't seem to print a
pdf at all - the plugin loads, but a single piece of paper prints (not the
pdf).  To the user, they click on the link, and then a print dialog box
appears - they click OK, and it prints what I wanted it to print!  If it is
an internet URL, it takes a moment before the print dialog box appears
because the page is being loaded in the background.  Since I know my
audience is internal and only using IE5.0, I can use this technique.  It
works GREAT!

If anyone wants to see a simple example of how it works, go here:


(Sorry for the annoying popup ads, my normal webserver is down at the

Thanks so much to everyone.


"Ein halber Laib ist besser als gar kein Brot."

> Printing a page online usually means printing more
> than what you actually want. Webpages are quite fancy
> nowadays, with ad banners on top, navigational links
> on the left, and so on. That's fine when you're
> viewing the page online, but when you're printing the
> page, you only want to print out the "actual content",
> and nothing else from the page! Many sites nowadays
> understand this, and provide an alternate "print"
> version of the document that surfers can go to and
> print out. Well, there's actually a much more elegant
> and seamless way of accomplishing the same thing, and
> that is by using the <link> tag. IE 4+ (and hopefully
> NS 5 when it comes out) supports a version of the
> <link> tag that allows you to specify to thr printer
> which file it should print when the user selects
> print. In other words, the job of locating the
> alternate print version of the document to print out
> is left to the printer, instead of the surfer. Take a
> look at the below example, and it will all be clear.
> Demo: Let's say you're interested in only printing out
> the content in gray below from this page. As the
> webmaster, I could have helped you out by creating
> another HTML document with only the below content, and
> telling you to go there and print that document
> instead. However, I'm not going to do that. Instead,
> I've prepared a Word document
> <link rel=alternate media=print
> href="printversion.doc">
> to the <head> section of this page, informed the
> printer to directly proceed to printversion.doc and
> print it when you select "print" on this page. In
> other words, the printer will print out
> printversion.doc instead when you choose "print" on
> printstyle.htm. To see this in action, try printing
> this page now (you'll need IE 4 or above)!

More information about the thelist mailing list