By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,117 Members | 2,178 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,117 IT Pros & Developers. It's quick & easy.

Code for printing out all hyperlinked documents on an html page

P: n/a
I'm looking for some code (html, javascript or otherwise) that I can
embed into my web site so that when the user clicks on one button, they
can send all hyperlinked documents on the page to a printer.

Any ideas?

Dec 20 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
gr*******@gmail.com wrote:
I'm looking for some code (html, javascript or otherwise) that I can
embed into my web site so that when the user clicks on one button, they
can send all hyperlinked documents on the page to a printer.

Any ideas?
Interesting question. Are you just wanting to print the page the user
is on when he clicks print? If so that can be done like this...

<A href="javascript:window.print()">Print this page</A>

or are you looking to visit each link on the page and print its contents
out? That's a bit more complicated.

You really can't do that automatically because each time you call
print() the browser will bring up a print dialog box so the user can
confirm the printout and adjust the printing details. So you can
really, usably, have only one print call going at any one time.

--
http://www.hunlock.com -- Musings in Javascript, CSS.
$FA
Dec 21 '06 #2

P: n/a
pcx99 <x@x.comwrote:
You really can't do that automatically because each time you call
print() the browser will bring up a print dialog box so the user can
confirm the printout and adjust the printing details. So you can
really, usably, have only one print call going at any one time.
Maybe you could create a new page which has one iframe for each of the
linked documents, and resize each iframe to display the complete document
without scrolling? Then if you printed the page containing these iframes
you would get a consolidated printout.

Much easier though to simply have some means of requesting a consolidated
page from the server and return them all as a single document.
Dec 21 '06 #3

P: n/a

pcx99 wrote:
gr*******@gmail.com wrote:
I'm looking for some code (html, javascript or otherwise) that I can
embed into my web site so that when the user clicks on one button, they
can send all hyperlinked documents on the page to a printer.

Any ideas?

or are you looking to visit each link on the page and print its contents
out? That's a bit more complicated.
This is what I'm looking for.

If we had to go with the consolidated page (according to another
poster), that would work but I'd prefer not to have to consolidate
because of potential issues with page breaks.

Jan 2 '07 #4

P: n/a

gr*******@gmail.com napísal(a):
I'm looking for some code (html, javascript or otherwise) that I can
embed into my web site so that when the user clicks on one button, they
can send all hyperlinked documents on the page to a printer.

Any ideas?
you can use php, and include.. you just take a list of documents into
loop, and you include all documents, one by one. you can add <hror
something similiar between documents.

problem is, that if you dont have these documents on you site, there
won't be pictures, or other content that doesnt use absolute paths.

Jan 2 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.