Although I've seen it says that you can't automatically print a webpage using JavaScript (http://javascript.internet.com/messages/print-page.html) is there actually no way of doing this? It would be very helpful in my application.
Printable View
Although I've seen it says that you can't automatically print a webpage using JavaScript (http://javascript.internet.com/messages/print-page.html) is there actually no way of doing this? It would be very helpful in my application.
You can't automatically print a web page.
You know those little pop-up ads that are so annoying? How would you like if they started coming out your printer?
thats very true, but i do need something like that for my web application. is there anyway that the javascript can tell as to whether the user has clicked ok on the print dialogue box when it appears using javascript?
You can't get around the dialog box as you may have seen with my example. Why do you want to know whether the user clicked ok or not?
then the user won't need to click on any more buttons than need be. Once the user has clicked ok, then its ok for the next record to be shown.
I doubt it. Printing webpages is a major security issue, and the browser is not going to give you very much control or options that have to do with it.
And how about setting the default setting of your printer dialog?
Like set your landscape to default?
If you can restrict/recommend your users to use IE 4.01 or higher, you can use the ScriptX component from http://www.meadroid.com/scriptx to control printing.
This component enables you to set the orientation, footer/header text and margins in code without changing the browser's original settings.
....and it's free!