This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Kubernetes in Action and have Marko Luksa on-line!
See this thread for details.
Win a copy of Kubernetes in Action this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Event Listeners in Java Print Service API  RSS feed

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For error handling in printing, i have implemented the PrintJobListener interface, but its strange that even if the printer is out of paper or the printer tray is open, the method printJobRequiresAttention(PrintJobEvent pe) of the above interface is not handling the above error. Even the System.out.println(..) statement inside this method is not getting executed.

 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you need to add the PrintJobListener to the PrintJob before you call print.

Darrin
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

i have a similar problem with some sample code - there a printjoblistener is implemented but nothing happens.

what i want is that when the printer runs out of paper during a printjob that an error occures or if there is any kind of failure like printer is off that the failure is reported back to the user e.g. over a jsp.

is this even possible ?

here is the sample code - maybe someone can give me a hint





 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!