print button on one page that prints another page

G

Guest

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>
 
G

Guest

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top