OK I have a program that:
- Creates a temporary file based on a
users input - Prints the File(Optional)
- Deletes the File (Optional)
My problem sits between stages 2&3, I need to wait for the file to finish printing until I can delete it.
FYI: the printing will take 5-10 minutes (large file to spool on an old computer)
So I need to from Java be able to to check if:
-
the defualt print queue is empty
-
the file is in use (note: File.canWrite() returns true, when printing)
Have you checked the Java Print API? From http://download.oracle.com/javase/1.4.2/docs/api/javax/print/event/PrintJobListener.html:
I imagine you can submit a print job and then monitor its status through this.
There’s also a fairly complete example at
(Note: URL seems to have changed, and points to potential malware)exampledepot.com/egs/javax.print/WaitForDone.html: