Java Printing - Spooling in Printing Queue -


i want print pdf file printer using java-based software netbeans. when ran code below, saw document in printing queue file name "java document" spooling status.

the questions are:

i want know why printer not printing document if in queue? because of code or because of printer?

here code:

    public string gonnago(string newfile) throws filenotfoundexception,   printexception, ioexception{       system.out.println("hello!" + newfile);      inputstream is;         = new bufferedinputstream(new fileinputstream(newfile)); //the new file 1 printed         doc doc = new simpledoc(in, docflavor.input_stream.autosense,null);         printservice service = printservicelookup.lookupdefaultprintservice();   // locate default print service environment.             system.out.println("default printer: " +    printservicelookup.lookupdefaultprintservice().getname());    //check if file  directory of file printed included          printrequestattributeset params = new hashprintrequestattributeset(); //add printing properties here         params.add(new copies(1));          docprintjob printjob = service.createprintjob(); //used determine whether print job finished         printjob.addprintjoblistener(new jobcompletemonitor());           service.createprintjob().print(doc, params);          system.out.println("exiting app");         is.close();     return null;                 } 

this output , not print anything. printer connected. i use canon ip2770 series, epson stylus tx117, , hp deskjet 2510 series latest drivers. enter image description here


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -