JAVA套接字-执行PJL命令

发布于 2024-09-28 07:40:25 字数 216 浏览 3 评论 0原文

在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

假面具 2024-10-05 07:40:25

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.

不爱素颜 2024-10-05 07:40:25

我为 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文