我是 java / grails 开发人员,致力于重新设计软件系统。
要求之一是让服务器端应用程序将数据发送到各种网络打印机以打印文本数据。
我在网上搜索了有关java网络打印的信息,但没有找到
我查看了 Java Print Service API、java.awt.print、javax.print,但没有找到任何有关连接网络打印机的信息。
是我想做的可能或有利的事情。由于缺乏调查结果,我相信服务器端软件不会直接与网络打印机交互。
如果可以的话,请给我指出一些资源。
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)
网络打印机通常与本地连接的打印机没有区别。它们首先在操作系统中设置,这使得它们可供 Java 打印服务使用。
如果您需要直接打印到 POS 打印机,它们通常有自己的二进制协议,您可以通过 TCP/UDP 使用。例如,爱普生拥有 ESC/POS 系统。
根据打印服务器的不同,您可以通过 CUPS/LRP/LPD/IPP 直接将 PostScript 发送到打印机。请参阅 http://www.cups4j.org 和 http://lpdspooler.sourceforge.net。
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.