SUMMARY: Printer Accounting for Postscript without NewsPrint

From: V.Sander (
Date: Fri Sep 24 1993 - 19:48:55 CDT


many thanks to all who have responded to my query. I received a lot of
responses. It seems that the problem of counting printed postscript-pages
has been discussed by many installations.

Some people told me, that they are extracting some information
from the postscript file (for example, number of showpages). This is what we
are doing at the moment, but this isn't sufficient, as this might have
nothing todo with the real number of printed pages.

The best and maybe easiest way to achieve a page counting is to run
a little postscript job before and after each real print job that
returned the number (absolute) that the printer has printed.

How you can do this?
   * First you have to use the pagecount - function supported by
     most postscript-printer.
     That means, you have to write a (input) filter which reads from
     stdin the postscript file to be printed, but before writing it to
     filedescriptor 1, it inserts the call of pagecount, reads from
     fd 1 the returned number of pages. After writing the file to fd 1,
     the same procedure is performed again and a simple subtraction
     will give you the real number of printed pages. Then the filter
     should write the information to the accounting file.

I have tried it for a Kyocera Printer, connected via serlia line and it worked.
Now I will try to write a filter for the QMS, connected vi Ethernet!!
Hopefully this will also work.
Some tips:

   * /etc/printcap should include the "rw"-facility. This means, that
     fd 1 is opened in read-write mode and is necessary to read
     the printer-information
   * Don't forget the following information:
     lpd does not write any accounting information. In fact the ("if") filter
     is responsible for collecting and writing these data.
     The input filter is called by lpd with something like:

     input_filter -n logname -h fromhost ... accounting_file
   * a great example on how such a filter might be programmed is available
     on the internet:

     Host (
     Last updated 01:50 20 Sep 1993

     Location: /text/postscript
      FILE -r--r--r-- 21045 bytes 01:00 8 Mar 1990 laser.shar.Z

Again many thanks to all who have responded !!!!!!!!!!!!!!!!!!!!!

Volker Sander

    Volker Sander
    Central Institute for Applied Mathematics
    Research Center Juelich
    52425 Juelich

    Phone: (+49) 2461 / 61- 6586

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:08:17 CDT