1

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

aravind
  • 11
  • 3
  • 1
    SO is not a platform where people code for you..Just try something and then ask if you need help – Akshay May 05 '17 at 11:19
  • 1
    Please [edit] your question to show [the code you have so far](http://whathaveyoutried.com). You should include at least an outline (but preferably a [mcve]) of the code that you are having problems with, then we can try to help with the specific problem. You should also read [ask]. – Toby Speight May 05 '17 at 11:22
  • I'm a fresher for SO. I found it difficult to understand it theoretically, that's why I wanted a sample code for reference..!!! – aravind May 05 '17 at 11:34
  • i already solved the capturing any info of printer job using java... check out my preview here https://www.youtube.com/watch?v=IqL7hcCfFVw&t=11s – gumuruh Dec 31 '22 at 04:02

0 Answers0