Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Print file with a paused printer

776900Dec 22 2008
Hello

With my java application I am printing with success a file.

Here is the code:
...
  DocPrintJob dPJ = services[0].createPrintJob();					
  fis = new FileInputStream(sFilename);
					
  DocAttributeSet das = new HashDocAttributeSet();
  Doc doc = new SimpleDoc(fis, DocFlavor.INPUT_STREAM.AUTOSENSE, das);
					
  // Monitor print job events
  PrintJobManagment pjm = new PrintJobManagment(dPJ);
  PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
  pras.add(new JobName(sFile, null));

System.out.println("PRINT");
  // Prints the file
  dPJ.print(doc, pras);
...
Everything works fine.

However, when the printer is in "Paused" status, the program stops at line "dPJ.print(doc, pras);" and waits until I stop it or until I "unpause" the printer.
How can I indicate a timeout in which after X seconds, the program continues or stop?

Thanks
Regards
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 19 2009
Added on Dec 22 2008
0 comments
154 views