<p>I am working on an application that will sport a web-based point of sale interface.</p>

<p>The point of sale PC (I am not sure as of now whether it will run on Linux or Windows) must have a fiscal printer attached to it, but like any web app, it is the server which processes all stuff. Both server and PoS machines are on the same LAN.</p>

<p>I must send the sale data in real time, and via the fiscal printer which uses the serial port, so printing a PDF or even a web page is not an option.</p>

<p>I've been told I could have a little app listening on web services on the client, which in turn talks to the printer instead of the server or the browser, but don't have a clue how to do it. Also, I'll most likely need to listen to any printer feedback (coupon number, for instance, which is generated by the printer) and hand it back to the server.</p>

<p>Any ideas?</p>

I did something similar to this a couple of yrs. ago. But in my case the server and the PC where in the same lan. Is your PoS within the lan? If so, I'll explain it to you.
In the mean time, if you have the "little app" covered you can take a look at the following:
http://java.sun.com/j2se/1.4.2/docs/api/javax/print/PrintService.html
The print service have a method to discover the printers registered within machine it is running on. So after you receive the message from the server on your app you just have to do something similar to the code shown in the link above:
Taked from,
http://java.sun.com/j2se/1.4.2/docs/api/javax/print/PrintService.html
```
```
DocFlavor flavor = DocFlavor.INPUT_STREAM.POSTSCRIPT;
PrintRequestAttributeSet aset = new HashPrintRequestHashAttributeSet();
aset.add(MediaSizeName.ISO_A4);
PrintService[] pservices =
             PrintServiceLookup.lookupPrintServices(flavor, aset);
if (pservices.length > 0) {
   DocPrintJob pj = pservices[0].createPrintJob();
   // InputStreamDoc is an implementation of the Doc interface //
   Doc doc = new InputStreamDoc("test.ps", flavor);
   try {
         pj.print(doc, aset);
    } catch (PrintException e) { 
    }
}
```
```