[cups-devel] Checking the printer status before printing

Frank Martini frankm at ezono.com
Wed Aug 27 07:22:13 PDT 2014


Hello,

working on supporting a CUPS printer in a protable Ultrasound device 
running Fedora 15 and using cups 1.6.4.
Until now we were supporting a single printer, for which we had our 
self-written driver
( there was no CUPS driver available for this printer when we started to 
support it).

Now the printer went end-of-life and we got a replacement including CUPS 
drivers for it.

What I'm trying to figure out at the moment is if I can get the status 
of the printer directly.
I have noticed that using

  cupsGetOption()

to get "printer-state" and "printer-state-reasons" gives me the status, 
but the status is only updated when starting
a print job.

Basically what I need is to know whether the printer is really ready for 
printing before the user decides to print.
IE. when the door is open or theres no paper in the tray, the user 
should get a notification immediately.
This is also the way it works now, when the printer is connected and 
online, the status is polled on a regular basis.
And only if the printer indicates ready, the user can issue a print command.

Can this be done using CUPS API?

I figured already how to find out which printer is actually online and 
available for printing,
but when I try to get the status, I always get 'idle'. Even if the door 
is open or paper is missing.

Any help you might be able to offer is appreciated.
Thanks,
Frank


This email has been scanned by Barracuda Networks.



More information about the cups-devel mailing list