aspose file tools*
The moose likes Java in General and the fly likes PrintJobListener not working properly... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "PrintJobListener not working properly..." Watch "PrintJobListener not working properly..." New topic
Author

PrintJobListener not working properly...

Muthu Ananth
Greenhorn

Joined: Jan 22, 2010
Posts: 4
Hi...

I had used "PrintJobListener" in my code. I have to listen print job was completed or not. But printJobCompleted() method in PrintJobListener was not working.

printDataTransferCompleted() and printJobNoMoreEvents() was called at all times.

Anybody help me. I have attached code with this Forum



Thanks in advance...

Viktor Pergjoka
Greenhorn

Joined: Aug 30, 2010
Posts: 16
Hi,


Alternatively you could program it on your own. You could get the attributes (this is an Set) and there is a value which represents the queue count ("queued-job-count").
You could then check this attribute to see if it is 0, so you would know that the printer finished its job.
If you use this approach, note that changes in the Set will not be modified so if you want to check a change you would have to call the getAttributes() method every time and compare the old Set with the new one.
Also note that because the return type is a Set, the order is not guaranteed to be the same on every call.


Here is an code example:



output:
color-supported
printer-is-accepting-jobs
printer-name
queued-job-count
Viktor Pergjoka
Greenhorn

Joined: Aug 30, 2010
Posts: 16
Or you can register for an PrintJobAttributeListener
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: PrintJobListener not working properly...
 
Similar Threads
PrintJobListener Question
Windows - Java - Printer - PDF - Status Issue.
A question on PrintJobListener interface
Printing to Wireless printer.
[PrintService] Pb while printing