Server-side network printing in java / grails
I am java / grails developer working on redesigning a software system.
One of the requirements is to have a sever-side application send data to various network printers to print text data.
I searched the web for info on java network printing, and came up sho开发者_运维知识库rt I looked into Java Print Service API, java.awt.print, javax.print and did not find anything on connecting to network printers.
Is what I am trying to do possible or favorable. The lack of findings leads me to believe that sever-side software does not interact with network printers directly.
If it can be done, please point me to some resources.
Network printers are typically treated no differently from locally connected printers; they are set up in the OS first and this makes them available to the Java Print Service.
If you need to print directly to a POS printer, they usually have their own binary protocol that you can use over TCP/UDP. Epson has the ESC/POS system, for example.
Depending on the print server, you may be able to send PostScript straight to the printer via CUPS/LRP/LPD/IPP. See http://www.cups4j.org and http://lpdspooler.sourceforge.net.
精彩评论