Creating greyscale queue for colour printer

John A. Murdie john at cs.york.ac.uk
Thu Sep 9 09:00:50 PDT 2010


I've returned to trying to create a greyscale queue for a colour printer - to encourage users to make cheaper greyscale prints when they don't actually require colour. (Many users with a nearby colour printer are going to use that rather than walk to a greyscale printer further away to save a few pennies - but the pennies soon add up to a large cost.) I'm using the SNMP page-counting facility of the 1.4.4 CUPS backends to count and record pages. (All one has to do is to add:

*cupsSNMPSupplies: True

to the end of the PPD file for the device in question. If the printer's actual pagecount is not used, it's far too easy to steal prints with specially-crafted PostScript. Believe me, it's been done here.)

My first attempt at a solution was to create a class with the name of the greyscale alias for a colour printer, which is the sole member queue of the class. One might imagine that one could set 'ColorModel=Gray' on the class but not on the member colour printer. Using the web pages provided by the CUPS scheduler, one can use 'Administration' -> 'Set Default Options' on the 'greyscale' class which don't apply to the colour printer - but all I am offered is 'Banners' and 'Policies'. Ok - I set 'Starting Banner' = 'Secret' on the class. Now, printing to the class causes a 'Secret' starting banner to be produced, but no banner is produced when I print to the colour printer. Even if what is I presume is the difficult-to-define problem to overcome of inheritance by the class of the options of the contained printer(s) (which might have very different option sets), I still see the line of the page_log file give the name of the actual printer instead of the name of the class (of course), so there's no way of analysing the page_log to find out how many colour pages and how many greyscale pages have been printed by a particular user, for charging.

My alternative method is to create two network devices for one printer, and to set 'ColorModel=Gray' for one but not for the other. The difficulty here is mutual exclusion - we can't have e.g. an invocation of one socket backend for one queue requesting the 'before' pagecount and the other doing the same, only for one to race to the printer, print some pages, and thus invalidate the other's 'before' pagecount. I'm still thinking and experimenting in this area.

Has anyone a solution for this using native CUPS functionality?

John A. Murdie




More information about the cups mailing list