Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing Multiple Documents with one click

Status
Not open for further replies.

MichaelL1

Technical User
Aug 30, 2000
2
US
Okay, here's my question.

I have a library of documents that is broken up first by subject, and then each subject is broken up into sections (each section is a separate HTML document). I want a way for the user to click on a button and have all the sections in a subject print. Is there a way that this can be done.

In experimenting, I've come up with loading the separate sections into temporary windows, grabbing the document.body.innerHTML from those and document.write-ing it to the main document. This produces a full document with all the sections, but I can't get that document to print after it's been generated. For some reason window.print() after all the document.writes doesn't work.

Any ideas or thoughts on how this could be done are greatly appreciated. Feel free to tell me a better way to consolidate separate HTML documents as well if that's out there.

Thanks very much,

Michael
e-mail: dante@orst.edu
 
Why don't do it on server side? You ever don't need cgi. Just do something like this:
You have document separated in sections like doc1_sec??.html and one doc1_print.html. You can either stop on it (many brand sites have "printer friendly" buttons on their pages) or name this button "print" and insert into this "printer-friendly" document onload event-handler onload="print(); history.go(-1)".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top