[cups.general] How to distinguish colored vs black-and-white jobs

alet at librelogiciel.com alet at librelogiciel.com
Sun Oct 26 00:08:20 PDT 2008


On Sat, Oct 25, 2008 at 11:44:23AM -0700, Michael R Sweet wrote:
> Adam Victor Brandizzi wrote:
> >
> > Is there a way to distinguish colored from black-and-white jobs in CUPS?
>
> Not at present.  There are third-party add-ons that may be able to do
> this for you - look at Pykota and other "accounting" backends...

Yes you can do this with PyKota by using the 'ink' accounting method for
that particular print queue, and the 'gc' pseudo-colorpsace like in :

--- CUT ---
[MyQueue]
accounter : ink(gc, 72)
coefficient_grayscale : 1.0
coefficient_colored : 2.0
--- CUT ---

This will tell PyKota to check whether each page is grayscale vs colored
mode, at 72dpi (faster). For each page PyKota will multiply the
coefficient by the percent of the page which is covered in this
particular color by the cost per page defined for this particular print
queue (with the "pkprinters --charge ... MyQueue" command).

In the case of the 'GC' pseudo-colorspace, this is always 100% of either
'grayscale' or 'colored', and 0% for the other one, since you don't care
about the real surface covered with ink, but only want to know if the
page is grayscale or colored. With other colorspaces (e.g. CMYK) the
real percent of ink coverage is used, and you have to define the
matching coefficients in pykota.conf, see pykota/conf/pykota.conf.sample
for examples.

In the above configuration, you've simply told PyKota to charge twice as
much for colored page compared to grayscale ones, of course you can use any
other set of values...

Hoping this helps

Bye,

Jerome Alet





More information about the cups mailing list