File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other JSE/JEE APIs and the fly likes Event Listeners in Java Print Service API Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Event Listeners in Java Print Service API" Watch "Event Listeners in Java Print Service API" New topic

Event Listeners in Java Print Service API

Krishna Chhabra

Joined: May 15, 2007
Posts: 9
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.

Darrin Cartwright
Ranch Hand

Joined: Dec 27, 2002
Posts: 107
I think you need to add the PrintJobListener to the PrintJob before you call print.


Life is good on the Ponderosa,<br />but mind where you step.
andreas zeiner

Joined: May 29, 2007
Posts: 1

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

I agree. Here's the link:
subject: Event Listeners in Java Print Service API
It's not a secret anymore!