Java: get printer status (paper low/out)

白昼怎懂夜的黑 提交于 2020-01-01 10:52:05

问题


I have printed this way

FileWriter imp = new FileWriter("COM2");
while ((linea = br.readLine()) != null) {
            imp.write(linea);
            imp.write(0x0A);
}

Well now Im using the port COM2, I have a printer that receive a hex code and its response will back in type byte, I dont know how to do it with java. Somebody has done it before?

Thanks.


回答1:


You could try using javax.print.attribute.standard.PrinterStateReason

This class is a part of the javax.print.* packages.



来源:https://stackoverflow.com/questions/5328519/java-get-printer-status-paper-low-out

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!