I realize ths question might be better fit for a forum specific to websites but there are a number of people here that are web knowlegable so here goes.
I have a web page where I want to create a “printable” version of the page in a popup window, have the user print the document and then close the window.
I have the popup window and print dialog displayed. That was not a problem. What I need to know how to do is to close the window after it is printed. Any ideas? Can this even be done?
Subject: Popup “Print Window”, print then close window on web?
Hi,
Google search for “window.onafterprint”
or
In your popup, I suppose you have a “print” link with window.print(), you can use the Javascript method setTimeout(‘window.close()’,5000) -close the window after 5 seconds- after window.print(), not very fun, but it goes…
Thierry
Subject: Popup “Print Window”, print then close window on web?
You can style the page for printing using a seperate css.
In that case you don’t need a pop-up window to create a printable version.
Example:
http://webdesign.about.com/cs/css/a/aa042103a.htm
Closing the window automatically can be annoying for the user. If it is a big document and the window closes automatically the user might end up with a document that is printed only half.