开发者

JAVA sockets - execute PJL command

开发者 https://www.devze.com 2023-01-20 16:20 出处:网络
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 (

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 s开发者_StackOverflow中文版amples. Is this possible?


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号