AJAX automatic print to specific printer?


#1

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


#2

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.


#3

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.


#4

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.


#5

Sean C. 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.


#6

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):

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


#7

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 F. <rails-mailing-l…@andreas-


#8

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