print button on one page that prints another page

D

Dub_Love

Ok, I'm looking to create a button that is on page 1, but prints a printer
friendly version that's on page 2 (but won't be seen).

For example, in my obituaries, my page gets cut off on the sides, and won't
print right. So what I wanted to do was create a duplicate (but modified) so
it would print off without being cut off. Then when you hit the "Print this
obituary" button on page one, it automatically prints the formatted page
without you knowing it.

Is this possible, and if so, how can it be done. Thanks guys!
 
M

Murray

It's not possible. The page that is printed must be open in the browser.

Here's how you would create the button -

Put this in the head of the document -

<script type="text/javascript">
function print_page(where){
var is_mac=(navigator.platform.indexOf("ac") != -1);
(document.all && is_mac)?
alert("Select \"Print\" from the menu") : where? where.window.print() :
window.print();
}
</script>

Put this in the body of the document -

<a href="javascript:print_page()">Print this</a>
 
D

Dub_Love

Yeah, I've already done that. Well, looks like I'll just create a hyperlink
to the page that'll be printing, and they can just print that one out.
Thanks!
 
Top