[thelist] Printing a URL

Sandra L sandra_etc at yahoo.com
Tue Mar 26 19:31:00 CST 2002


Not So, this works well but only in IE.

Description:

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)!

Change printversion.doc to the file intended to be
used for printing. The file can be of virtually any
format (pdf, Word etc). When the user selects "Print",
the printer will look for this file and print it
instead of the current page. Netscape will simply
ignore this tag, and print out the original page.

Pretty neat huh?

Sandra Leske.




--- "kevin D. white" <kevin.white at bitshift.ws> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> The function window.print() does not accept any
> arguments so I doubt
> that you can print a page without loading it into
> the browser.  In
> order to print a page the browser has to render it
> at some point.
> There is no way around the rendering step.  There
> are a couple of
> ways you might be able to hide the loading:
>
> 1) Load the page in a hidden frame/layer and execute
> the print()
> function from there.
> 2) Pop a window with the page to be printed.  Send
> the daughter
> window to the back/minimize it/move it off-screen.
> Execute the print
> from there.
>
> Again, the browser absolutely has to render the page
> first before
> printing.
>
>
> - ----- Original Message -----
> From: "bread_man" <bread_man at hotmail.com>
> > Thanks. I know my audience strictly uses IE5.0 and
> above.  My goal
> > is to print a webpage without loading it.  I've
> found lots of
> > documentation on using javascript to print the
> current page, but
> > what if I wanted to print page2 from page1 without
> loading page2?
> > Is this possible?
>
> -----BEGIN PGP SIGNATURE-----
> Version: PGPfreeware 7.0.3 for non-commercial use
> <http://www.pgp.com>
>
>
iQA/AwUBPJ921FZZFo27GBIvEQJU5wCgzplxc0rwGaTNNWrs5OZXBjeDp3kAoJ29
> H4wqD07xlxI+8NRXXP4xoHUP
> =iaDP
> -----END PGP SIGNATURE-----
>
>
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of thelist go to:
> http://lists.evolt.org Workers of the Web, evolt !


__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/



More information about the thelist mailing list