tags:

views:

51

answers:

1

hi guys..

i am creating a jsp application in which i want to print a file in client (linux os only )machine by sending a command lets say "cat /root/data.txt >/dev/lp0" to the local port of the client systm because my printer is a thermal printer which will print a ticket... the data.txt will be on the client machine.. and i cant use window.print();

but i don't know how to run client command shell from server through scriplet /javascript)... and i i also cant use activexobject as the client os is linux..

so plz help me...

smruti,Delhi

+1  A: 

I don't think this is possible in pure JavaScript, it would be a security hole. You could set up a website, that prints spam when I surf on it.

There might be some technique that allows you more access to the client, e.g. Java Webstart, Flash or somethings else, but pure JS would not do the job right now.

(I know Webstart can get read/write access to your filesystem, if you use signed jars and the client confirms it. And Flash can access you Webcam if you allow it, so I guess it may access your printer as well)

Tim Büthe