java - get activity status of a printer

932 views Asked by At

I have implemented a printing system in java. I need to get printer status, So I used AttributeSet in this way:

PrintService service = PrintServiceLookup.lookupDefaultPrintService();
AttributeSet attributeSet = service.getAttributes();
for (Attribute a : attributeSet.toArray()) {
     System.out.println(a.getName() + ": " + attributeSet.get(a.getClass()).toString());
}

This returns me below output(even if the printer is off or pause):

printer-name: EPSON LQ-350 ESC/P2
color-supported: not-supported
printer-is-accepting-jobs: accepting-jobs
queued-job-count: 0

But, I need to printer status more specific, for example I need to know whether the printer is off or pause, or whether paper is ok or not. How can I get exact printer status?

0

There are 0 answers