bypass or supress print dialog box
Hi!
I'm developing this web aplication for an intranet where the user can print a list, I want this to be automatic, I know I can do so by using a java script, but then I was asked to avoid the browser to show the printer dialog box so the printing process would be much more faster and easier for the user; I found some info about this in a forum (http://www.codingforums.com/archive/index.php?t-224.html) and I understand that acording to this site what I want could be posible in former os and ie versions but not in the new ones with updates (and I understand why). My cuestion is; Is it true that supressing or bypassing the printer dialog box by an script isn't posible? and if so maybe someone can point me out to a ms oficial article related to this (as I must prove what I was asked isn't posible) for I've looked within this site and I haven't been able to find anything related (Maybe I haven't looked enough... :P). Thanks
[1089 byte] By [
chuy244] at [2008-1-5]
Hi chuy244! I'm looking for the same information. Have you found anything yet?
Thanks.
As a developer, AND a user, I personally HATE this behavior (skipping the print dialog).
This is my #1 annoyance with MS Word, thank goodness most applications didn't follow suit.
I typically have access to at least 4, if not more printers... plus the ability to print to a file, or a PDF.
If I don't get the opportunity to pick: (a) what printer, (b) what paper size, (c) what orientation, (d) what scale, (e) color vs. black & white, and (f) what print quality, I get very upset.
These are user options and preferences. Unless you have a very good reason to avoid uses choosing these options, please do not remove the users choice.
In IE7 now, there is at least the option to do a proper preview/scale/rotation... it's only minor progress, but it beats the heck out of what IE6 provided.
Steve
Yes, I would find it annoying too. Unfortunately our clients want this behavior in our web application. From my research so far, it seems I can't do this with javascript alone. I was wondering if it would be possible to do this with an ActiveX control? Any suggestions?
Thanks for the comments, I understand what you say, but yes... I do have a good reason to skip the print dialog box, as the app I'm developing is intented for internal use at my company and users (we suppose) will find the app much more friendly if this step is avoided. So far I haven't been able to find anything related (not even an article stating this is really imposible). I'll keep on my quest...
MeadCo ScriptX will do it, but it comes at a price: $599
If you're willing to pay, it does exactly what you're looking for: http://www.meadroid.com/scriptx/docs/samples/techie.asp
But, I wish SOMEONE would let us know how we can do this without paying so much. Does anyone know if Microsoft built anything like this in?
Version of Word 2003 will bypass the print box. Version of Word 2000 will not bypass print box. I am trying to find how to bypass in Word 2000.
Hi All,
IE7 supports window.print() as opposed to the earlier versions support for printing using the webbrowser object and the ExecWB method. Window.print() loads the printer selection dialog before spooling the document to the selected Printing device. The ExecWB method of printing requires the setting 'Allow scripting of the Web Browser' to be enabled in IE7. An untried suggestion would be to load the document to be printed in a hidden window (top -1000, left -1000) and to place the window.print() script in the documents onload event. I think this method may be defeated by a users popup blocking settings security settings for scripted windows.
You may get some ideas looking at the printto context menu handler for HTML file types in the shell file type handlers...
rundll32.exe c:\windows\system32\mshtml.dll, PrintHTML "%1" "%2" "%3" "%4"
You could call the above command using Windows Scripting, or you may like to look at creating a custom protocol handler that could be installed on your clients' workstations enabling a hyperlink protocol (for example) like href="printto
efaultPrinterName&Document=ClientReport.aspx"
You can use windows scripting from within a web document by using javascripts' ActiveXObject method...
var sURL = document.location.href;
var WshShell = new ActiveXObject("wscript.shell");
WshShell.run("rundll32.exe c:\windows\system32\mshtml.dll, PrintHTML " + sURL); // look up the optional arguments to the run method... wait etc.
But this will have covenants depending upon the security zone where your web document resides. (hint: MTW=Mark of the Web)
I personally would try the custom protocol handler route, though I think you are asking for trouble if you do not give the user intervention in the printer selection process. How will you support events like the printer running out of paper or a network connection being down.... whats the old saying(?), if it can happen then it will happen... (sic... I am getting old. I've forgotten who said that quote).
Regards.
Regards.
unique_username wrote: |
| As a developer, AND a user, I personally HATE this behavior (skipping the print dialog). This is my #1 annoyance with MS Word, thank goodness most applications didn't follow suit. I typically have access to at least 4, if not more printers... plus the ability to print to a file, or a PDF. If I don't get the opportunity to pick: (a) what printer, (b) what paper size, (c) what orientation, (d) what scale, (e) color vs. black & white, and (f) what print quality, I get very upset. These are user options and preferences. Unless you have a very good reason to avoid uses choosing these options, please do not remove the users choice. In IE7 now, there is at least the option to do a proper preview/scale/rotation... it's only minor progress, but it beats the heck out of what IE6 provided. Steve
| |
Well thats all well and good for you but as a developer who actually has to develop for actual people some of us need to can the print option. So the original question still stands.
My customer wants a simple button on his html page that he simply pushes, and out of his printer pops a single sheet of paper, with exactly the information he wants printed. In his case he wants the first page (and only the first page) of the html page where the print button is on. He wants it printed in landscape, and on the default printer. He does not want to have to click on "OK" in the print dialog box, or change any of the settings in the print dialog box. He knows full well that he can do this by pushing ALT-F P... and clicking all the settings he wants. He wants a one button push.
So is their a way I can set all the answers/options that the print dialog box asks and push that stupid OK button so the dialog box never comes up or not?
Hi,
I hope they are paying you by the hour. We have all had problem clients that request functionallity that may appear simplistic and menial to them ( I want my web site to work on all browsers!), but which are outside the norm or for the effort required do no justify the return. Which is all well and good so long as you get paid for your efforts.
The simple answer is that there is no web page scripting that will bypass the printer selection dialog, and you will have to look at a custom browser extension to find a solution.
Some third-party extensions that come to mind are snagit and pdfcreator. These have options to print the currently displayed web page. They may be programmable which would allow you to script them in your web pages.
I hope that when you do find a solution, your client does not phone you up to complain that it is not working, only to find that the printer power plug has been has been knocked out by the cleaner. All good if they are willing to pay.
Regards.