JAVA套接字-执行PJL命令
在Java中,我尝试使用套接字连接到打印机(Canon iR5050 PCL6),使用端口为9010的主机IP。我想使用PJL命令获取打印机的状态。我将 PJL 命令 (\x1B%-12345X@PJL INFO USTATUS \r\n\x1B%-12345X\r\n) 写入套接字输出流,并尝试从输入流读取打印机的状态。没有从输入流中读取任何信息。这怎么可能做到呢?如果有人可以分享一些样本,那就太好了。这可能吗?
In Java, I am trying to connect to a printer(Canon iR5050 PCL6) using Sockets, using the host IP with port as 9010. I want to get the status of the printer using PJL command. I write the PJL command (\x1B%-12345X@PJL INFO USTATUS \r\n\x1B%-12345X\r\n) to the socket output stream and try to read the status of the printer from the input stream. No information is read from the input stream. How could this be done? It will be great if somebody can share some samples. Is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
LPD
根据另一个问题使用 PS 文件在 Java 中打印< /a> 我很确定您的佳能会使用 LPD,并且 LPD 会以更普遍的协议报告打印机状态。
LPD
As per the other question Printing in Java using PS file I'm pretty sure your canon will speak LPD, and LPD will report printer status in a more ubiquitous protocol.
我为 Java 编写了一个 pjl 库。它处理多种功能,包括 USTATUS 事件。我目前正在一个专有应用程序中使用它来监视打印作业,实际上在打印时对打印的每一页进行计数,以及从打印机本身获取统计信息。
I wrote a pjl library for Java. It handles several features, including USTATUS events. I'm currently using it in a proprietary application for monitoring print jobs, actually counting each page printed as it is printed, as well as getting stati from the printer itself.