Is it possible to print directly to an XP Pro default printer without having to go through an intermediate dialog? The clients are XP Pro with IE. The printer is accessed directly through the network, but could easily be setup as a Windows shared printer if that helps us out. I''ve seen where I can use window.print but the user still has to click OK. I would like to avoid any clicks at all for this particular page. The application only runs on our LAN and users would like this part automated since they are printing 100 times a day to the same printer from the RoR app. Automating the print function would save 300-400 clicks a day. I would prefer to do this through JavaScript, but could result to CGI for messy solution. CGI would require me to have printing configured on Linux which I''m trying to avoid. JavaScript solution is also more flexible long term. thanks for your help, Sean -- Posted via http://www.ruby-forum.com/.
you''re always going to have to go through the windows print dialog. There''s no way around that, especially from a web application. you''re restricted by the print functionality built into the browser. On 4/12/06, Sean Clark <sclark@pellahealth.org> wrote:> > Is it possible to print directly to an XP Pro default printer without > having to go through an intermediate dialog? The clients are XP Pro > with IE. The printer is accessed directly through the network, but could > easily be setup as a Windows shared printer if that helps us out. I''ve > seen where I can use window.print but the user still has to click OK. I > would like to avoid any clicks at all for this particular page. > > The application only runs on our LAN and users would like this part > automated since they are printing 100 times a day to the same printer > from the RoR app. Automating the print function would save 300-400 > clicks a day. > > I would prefer to do this through JavaScript, but could result to CGI > for messy solution. CGI would require me to have printing configured on > Linux which I''m trying to avoid. JavaScript solution is also more > flexible long term. > > thanks for your help, > Sean > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060412/e6bfca9a/attachment.html
Thanks, Shane. That''s a bummer. for an ugly hack, is it possible to have RoR fork out and return the HTML to the browser by also print the resulting HTML directly to the network printer? Does anyone have experience with linux web server to HP network printers (or Windows print server)? If the answer is a book, then I probably don''t what to travel that dark road. We''re talking about saving 1 measily click or keypress. -- Posted via http://www.ruby-forum.com/.
Michael Greenly
2006-Apr-12 17:34 UTC
[Rails] Re: AJAX automatic print to specific printer??
Sean Clark wrote:> Thanks, Shane. That''s a bummer. > > for an ugly hack, is it possible to have RoR fork out and return the > HTML to the browser by also print the resulting HTML directly to the > network printer? Does anyone have experience with linux web server to > HP network printers (or Windows print server)? > > If the answer is a book, then I probably don''t what to travel that dark > road. We''re talking about saving 1 measily click or keypress.I have almost no knowledge about it about this may help... http://raa.ruby-lang.org/project/ruby-cups/ http://www.cups.org/ It seems perfectly reasonable that you should be able to print to most network printers this way. -- Posted via http://www.ruby-forum.com/.
Thanks, Michael. That''s definitely my dark road. I''m going to try and get away with just using the onLoad window.print stuff. If the users get pitchforks out, then I''ll look into the CUPs stuff. Thanks again. -- Posted via http://www.ruby-forum.com/.
Maximilian Schöfmann
2006-May-10 10:36 UTC
[Rails] AJAX automatic print to specific printer??
Hi Sean,> Is it possible to print directly to an XP Pro default printer without > having to go through an intermediate dialog? The clients are XP Pro > with IE.I assume that this is an intranet application and that the clients can add this application to the "Trusted Sites" in IE (otherwise they will get an ActiveX warning). If thats the case, it is possible: For IE, you have to add some javascript to the page your want to print (found in a forum post some months ago): <script language="JavaScript"> function printWithoutDialog() { self.focus(); var OLECMDID_PRINT = 6; var OLECMDEXECOPT_DONTPROMPTUSER = 2; var OLECMDEXECOPT_PROMPTUSER = 1; var WebBrowser =''<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 '' + ''CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>''; document.body.insertAdjacentHTML''beforeEnd'',WebBrowser); WebBrowser1.ExecWB(OLECMDID_PRINT,OLECMDEXECOPT_DONTPROMPTUSER); WebBrowser1.outerHTML ='''' } </script> For Firefox, there''s even a simpler solution if you have the possibility to alter the prefs of the clients (I''ve done this for a kiosk-mode application): In your firefox, browse to "about:config" and right click to add a new *boolean* value named "always_print_silent" (true). Done. Both solutions will print to the default printer of the system. In FF, you can change the printer with the "print_printer" value. HTH, Max
> For Firefox, there''s even a simpler solution if you have the possibility > to alter the prefs of the clients (I''ve done this for a kiosk-mode > application): > In your firefox, browse to "about:config" and right click to add a new > *boolean* value named "always_print_silent" (true). Done. > > Both solutions will print to the default printer of the system. > In FF, you can change the printer with the "print_printer" value. > > HTH, > Maxpor favor me aclaran este post sobre imprimir sobre Firefox, que no lo entiendo y tengo la necesidad de imprimir directamente a la impresora por default, sin que se habilite la pantalla de impresion. gracias -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Creo que no es possible, por que mal websites queire imprimir mal cosas. Lo siento, mi espanol es muy mal. Otros personas aqui probablament no habla espanol. -Ryan On Jan 19, 9:30 am, William Fernando <rails-mailing-l...@andreas- s.net> wrote:> > For Firefox, there''s even a simpler solution if you have the possibility > > to alter the prefs of the clients (I''ve done this for a kiosk-mode > > application): > > In your firefox, browse to "about:config" and right click to add a new > > *boolean* value named "always_print_silent" (true). Done. > > > Both solutions will print to the default printer of the system. > > In FF, you can change the printer with the "print_printer" value. > > > HTH, > > Max > > por favor me aclaran este post sobre imprimir sobre Firefox, que no lo > entiendo y tengo la necesidad de imprimir directamente a la impresora > por default, sin que se habilite la pantalla de impresion. > > gracias > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---