Java: get printer Jobs From printer

610 Views Asked by At

I'm looking for a method to get Print Jobs data from Printer.

I'm getting only Printer queue count and printer name..

my code.

if (myPrinter != null) {  
        PrintServiceAttributeSet att =myPrinter.getAttributes();
        for (Attribute a : att.toArray()) {
            String attributeName;
            String attributeValue;
            attributeName = a.getName();
            attributeValue = att.get(a.getClass()).toString();
            String gh = (attributeName + " : " + attributeValue);
            if (gh.equals("printer-is-accepting-jobs : not-accepting-jobs")) {
                 System.out.println("Printer Not Available");
            }
            if (gh.equals("queued-job-count : 0")) {
                System.out.println("queued-job-count");
            }
            System.out.println(gh);
        }

Any possibility to get all Print jobs From Printer..

0

There are 0 best solutions below