Click to See Complete Forum and Search --> : Print button that doesn't bring up the print dialog box


Troy Wells
02-05-2003, 01:07 PM
I need to add javascript code to a print button that prints the current page without bringing up the Print dialog box.

I've already read that it cannot be done because its a security thing. However, I need to do it because of a security thing. The print dialog box has a print to file option, which brings up a save as dialog box. I can't allow users to see this box.

I either need a way to print directly after clicking or a way to suppress that option.

THere is a way to do for IE, but it does not work for Netscape. I'm using Netscape 7.0 for Solaris.

Thanks!!
Troy

Troy Wells
02-06-2003, 07:08 AM
Shame on you and everyone else for not realizing that many JavaScript functions "take over" a machine and run lots of things on a web page.

Most any code can be used in this way. Shame on you for not realizing that the security risk in my case is with the Print dialog box being displayed.

Troy

Troy Wells
02-06-2003, 07:44 AM
Perhaps I should have mentioned JavaApplets which often connect to things outside the web page. I see these on pages all the time. Do they not connect to things outside the web page?

As best I understand it, Java Applets and JavaScript itself are simply tiny applications. Tiny applications can do anything they are programmed to do.

By the way, given the number of posts I've come acrross on many forums with the same request as my, I don't think my world is as "little" as you may think. Most any one I talk to gets their "feathers ruffled" when I tell them that the forum posts I've seen say that this cannot be done.

Also, I have not confirmed this, but I was told by a developer at my company that Netscape 7.0 now supports the same objects used by IE to perform this function. I'll post back when I determine if it actually works.

Troy

Webskater
02-06-2003, 09:10 AM
Lot's of people now are developing applications with web front ends for businesses. At the moment I am working on an application that will run a business with 1000 mobile engineers and 500 administrators. When we place a purchase order and want to print it - we don't want a print dialog box getting in the way. So we have an ActiveX object that allows us to print properly (without the browser interpreting things incorrectly). Of course its IE only. My, meandering, point is browsers are not just about the web any more - they are becoming the front end to many applications.

khalidali63
02-06-2003, 09:18 AM
Me too.
:-)

I actually think as dave said that javascript must not have the ability to take control of a users machine.
As in the webskaters case,you have an activeX control and Troy may endup using an applet,The epoint is a user must always have to allow this behavior from its machine,it must not automatically take charge.

Khalid

Troy Wells
02-06-2003, 09:37 AM
I wouldn't mind giving the users the Print dialog and the chance to cancel if I could just find a way to disable the "Print to file" option.

Any ideas?

Troy