[cups.development] how can I pause/resume printer using cups
Michael Sweet
msweet at apple.com
Thu Jan 28 09:08:26 PST 2010
If you want to stop the printer from your filter, use:
fputs("STATE: paused\n", stderr);
Note that this will immediately cause your filter to be killed (SIGTERM) and the queue will be stopped, which is probably *not* what you want.
Your filter or backend can set another STATE: value and then wait for notification (via some external IPC mechanism with the user session), effectively pausing the current job. For example:
fputs("STATE: +com.vendor-authentication\n", stderr);
... send a notification to a user-space daemon/agent and wait for a response ...
fputs("STATE: -com.vendor-authentication\n", stderr);
How you communicate with the user session is entirely operating system specific - on Mac OS X use Launch Agents:
http://developer.apple.com/mac/library/technotes/tn2005/tn2083.html
On Linux you'd probably use DBUS.
On Jan 28, 2010, at 5:17 AM, akbar wrote:
> Hi every one,
>
> I need to pause the printer for the current job and resume the printer after authorization.can any body give some sample code for this.
>
> please help me.
> _______________________________________________
> cups-dev mailing list
> cups-dev at easysw.com
> http://lists.easysw.com/mailman/listinfo/cups-dev
___________________________________________________
Michael Sweet, Senior Printing System Engineer
More information about the cups
mailing list