[cups.general] Page accounting

Helge Blischke H.Blischke at srz-berlin.de
Fri Jun 11 04:49:40 PDT 2004


Matthias Clasen wrote:
> 
> I tried to analyse why I don't see reasonable page accounting
> information when I request "job-media-sheets" and
> "job-media-sheets-completed" for my jobs. Here is what I found:
> 
> - Normally, pstops is responsible for emitting PAGE: m n messages,
>   except if there is another filter specified in the ppd file, e.g.
>   foomatic-rip
> - In that case, foomatic-rip is reponsible for emitting PAGE: m n
>   messages. To this end, it injects some PostScript code into the
>   job data which causes gs to emit PAGE: m n messages.
> - It then goes off to run the renderer using the cmdline specified
>   in the ppd file. Unfortunately, the "renderer" is not gs, but cat
>   if prefiltering is turned off for the queue...
> 
> Turning on prefiltering fixes this part, but then the ipp backend
> emits a PAGE: total n line when it gets a "job-media-sheets-completed"
> attribute back from the remote side.
> Unfortunately, due to brokenness on the other side, the value is 0,
> so the job-media-sheets-completed value gets set back to 0 by the
> daemon. Shouldn't it maybe use MAX() there ?
> 
> I'm not quite sure which parts are just my misunderstanding how
> page accounting is supposed to work, which parts are incompleteness
> of the cups ipp implementation, and which are honest bugs...
> 
There is a system (based on Python) for accounting and quota handling
(which can be configured to do accounting only). Go to the respective
link on the CUPS home page for more details.

If you are willing to tailor your own accounting system, I'd suggest to
feed the jobs through Ghostscript's (preferrably ESP gs) bbox device
which logs the bounding box for every page in the job; interpreting
the log for accounting purposes is then up to you. This approach would
have the advantage not to require DSC conformance - if would even work
for
"obfuscated postscript" (once there was a newsgroup on this topic).

Helge


-- 
H.Blischke at srz-berlin.de
H.Blischke at srz-berlin.com
H.Blischke at acm.org




More information about the cups mailing list