views:

89

answers:

2

How can I detect if there is no more paper in the printer, "paper out" with Java? I don't know if it is possible to do in Java, but I would like to use it if possible.

I am using Java on Windows.

+3  A: 

I'm not java expert but I'd be very surprised if there was a java standard way of doing this. It's clearly depending on your specific printer and its driver.

Check if there is an SDK for your printer. In that case it is very likely to provide you an API to achive that. It will most probably be a windows dll, you can interface with it through JNI.

Gianluca
+1  A: 

If you use the Java Print Service API you can use the Attribute "PrinterIsAcceptingJobs" to test if the printer is ready. http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/javax/print/attribute/standard/PrinterIsAcceptingJobs.html

The print service api takes a while to learn but it's worth it IMHO.

vasquez