在java / grails中进行服务器端网络打印 [英] Server-side network printing in java / grails

查看:184
本文介绍了在java / grails中进行服务器端网络打印的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



其中一项要求是让服务器端的应用程序将数据发送到各种网络打印机,以便打印文本数据。



我在网上搜索了关于java网络打印的信息,并且发现了简单的
我查看了Java Print Service API,java.awt。打印,javax.print,并没有发现连接到网络打印机的任何东西。



是我试图做的可能还是有利的。缺乏调查结果让我相信服务器端软件不会直接与网络打印机进行交互。

如果可以这样做,请指出一些资源。 / p>

解决方案

网络打印机通常与本地连接的打印机没有区别。它们首先在操作系统中设置,这使它们可供Java打印服务使用。



如果您需要直接打印到POS打印机,他们通常都有自己的打印机二进制协议,您可以通过TCP / UDP使用。例如,爱普生拥有ESC / POS系统。



根据打印服务器的不同,您可以通过CUPS / LRP / LPD / IPP。请参阅 http://www.cups4j.org http://lpdspooler.sourceforge.net


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.

解决方案

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.

这篇关于在java / grails中进行服务器端网络打印的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆