chuy244

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




Re: Internet Explorer Web Development bypass or supress print dialog box

tipster8

Hi chuy244! I'm looking for the same information. Have you found anything yet

Thanks.





Re: Internet Explorer Web Development bypass or supress print dialog box

unique_username

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




Re: Internet Explorer Web Development bypass or supress print dialog box

tipster8

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



Re: Internet Explorer Web Development bypass or supress print dialog box

chuy244

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... Stick out tongue




Re: Internet Explorer Web Development bypass or supress print dialog box

Tech-Ed

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





Re: Internet Explorer Web Development bypass or supress print dialog box

sdangelo

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.




Re: Internet Explorer Web Development bypass or supress print dialog box

IECUSTOMIZER

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="printtoBig SmileefaultPrinterName&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.






Re: Internet Explorer Web Development bypass or supress print dialog box

jleslie48

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






Re: Internet Explorer Web Development bypass or supress print dialog box

IECUSTOMIZER

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.






Re: Internet Explorer Web Development bypass or supress print dialog box

chuy244

Thank's for your comment IECUSTOMIZER, at least now I know where not to keep looking... Stick out tongue... I'll take a deeper look at what you say on your past comment and I hope I can find something.... and by the way... no, they are not paying by the hour (maybe that is why it's been so long since I've posted the question and I'm still looking... Stick out tongue).. but although I know what kind of request I've been asked I'll try (as far is reasonable) to give a solution. If I find something... for sure I'll post it here (as far it's is an addecuate and ethical solution ofcourse... Stick out tongue)






Re: Internet Explorer Web Development bypass or supress print dialog box

anuno

Hi,

Usually user should have full control of printer devices. However I think you are not aware of other situations where user should not be able to do so!!!
This affirmation sounds like a heresy compared with your text, but following are situations I found with my customers:

a) Print bar codes to a text printer with labels (User should not select another printer other then that);

b) Printing small text messages (2 to 6 lines) to a printer with continuous paper, so user could cut a small strip of paper with each message. Otherwise a full paper sheet would be need.

I am still looking for a solution of this problem, since my customer wants to send output to the printer using only a click and in the quickest way.

In those situations, print dialog is annoying user and not helping him.

Even using print dialog I could not found a way to get the result of user selection (¡°Print¡± or ¡°Cancel¡±).

I am using Java comand ¡°document.execCommand("Print");

Did some one have a solution to get user selection from Print Dialog

Thank you,

Regards,

Antonio Nuno






Re: Internet Explorer Web Development bypass or supress print dialog box

unique_username

If you have a customer that specifically wants this behavior, then by all means apply it where appropriate.

I would suggest either an Extension that presumably has some sort of higher priveleges, and you can enforce more appropriate logic...

or

(kind of hacky) create a tool that "sniffs" for an IE print dialog, matching your needs and specific pages. AutoHotKey has the ability to jump in here, and automatically hide the print dialog, make certain selections, and send the print job to the given printer.

For any case outside of these specific scenarios, I would let the user pick what they want.

PS Although I recommend the extension approach, I have no expertise in building extensions for IE (only Firefox), thus I'm afraid I can't assist.

Good Luck





Re: Internet Explorer Web Development bypass or supress print dialog box

chuy244

unique_username: thanks for the info...

So far we've triede the extension aproach, but we haven't been able to achieve exactly what we need as there's more to the problem as we intend to run the app on thin clients (but that's another thing). You mention something about AutoHotKey what's that exactly





Re: Internet Explorer Web Development bypass or supress print dialog box

abbasi541

hi all,
we have same problem and looking for a solution, we want to find a solution like http://print.coupons.com has implemented to print coupons. If someone have any idea about that please do inform at this thread.
with Best Regards
abbasi541