Comment 1 for bug 126139

Revision history for this message
DurvalMenezes (durval) wrote :

Investigation and solution:

    After some investigation, I found that CUPS depends on 'PAGE: n c' lines being
    output to stderr by pstops or one of the filters that are called for each page
    printed. Also, I found that when there's a PPD file configured for the printer,
    and that PPD defines at least 1 filter for it (as is the case with the.PPD files
    included with the foo2zjs package), the pstops program does NOT output the
    'PAGE: n c' lines, and so the CUPS page accounting can't register the number of
    pages being printed. I checked the source for other filters (e.g, rastertohp)
    and found that they indeed do output the required 'PAGE: n c' lines.

    From the above, I concluded that the problem is caused by foo2zjs not outputting
    the 'PAGE: n c' lines to stderr, so I made a patch to the current Ubuntu package
    sources (see attached patch).

    I've tested it and now page accounting works perfectly, with no ill
    side-effects (at least none that I can detect).

    I've also posted the above fix upstream (updated to the last upstream version),
    both to foo2zjs community forum at http://foo2zjs.rkkda.com/forum/read.php?8,488
   and directly to its author.