Java直接打印到Postscript网络打印机 [英] Java printing directly to a Postscript network printer

查看:382
本文介绍了Java直接打印到Postscript网络打印机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在内存中(在Java Tomcat网络应用程序中)有Postscript代码/数据(?),我想直接将其发送到联网的PS打印机。有没有一种简单的方法(即只是弹出一个端口并发送文本)来打印此内容,从而绕过所有特定于O / S的驱动程序和内容(甚至希望不需要额外的jar)?

I've got Postscript code/data (?) in memory (in a Java Tomcat webapp) that I'd like to send directly to a networked PS printer. Is there an easy way (i.e. just popping open a port and sending the text) to print this, bypassing all of the O/S-specific drivers and stuff (and hopefully not even requiring extra jars)? A link to example code showing how to do this?

谢谢,
Dave

Thanks, Dave

推荐答案

在目标打印机的LPR端口上打开一个TCP套接字。

open a TCP socket to the LPR port on the target printer.

发送数据;只要打印机理解,您就很酷。

send your data; as long as the printer comprehends it, you're cool.

完成后不要忘记换行。

(然后关闭端口。)

这篇关于Java直接打印到Postscript网络打印机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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