Server-side network printing in java / grails

谁都会走 提交于 2020-01-11 12:33:29

问题


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 short 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.


回答1:


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.



来源:https://stackoverflow.com/questions/7368272/server-side-network-printing-in-java-grails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!