Click to See Complete Forum and Search --> : window.print() options


Andyson
04-02-2003, 02:02 AM
Hi,
i have a small problem with the window.print() in JScript.
I offer my visitors a button, where they can print the HTML page.
It's simple JavaScript:
javascript:window.print()
Now i have 2 Questions:
1. How can i define the print option, means how can i give the window.print() a parameter, which says that the page should be printed in landscape format, not in portrait format. How can i do this?
2. Is there any JS-Code, that can print the page automatically, means: i press my button and the page will be printed out WITHOUT the print box of my browser appears where i have to confirm "print". Is this possible?
Thank you
Andy

gil davis
04-02-2003, 06:01 AM
Originally posted by Andyson
1. How can i define the print optionYou can't. There are CSS styles that can define certain print aspects, but nothing in javascript.2. Is there any JS-Code, that can print the page automaticallyNo. This is a security issue. Making a client print something without the user's permission would be a security violation.

Andyson
04-02-2003, 06:27 AM
How does it work with CSS?
Some code in CSS and it works if i use the javascript:window.print() ?