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
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.
* /etc/printcap should include the "rw"-facility. This means, that
fd 1 is opened in read-write mode and is necessary to read
* 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 src.doc.ic.ac.uk (184.108.40.206)
Last updated 01:50 20 Sep 1993
FILE -r--r--r-- 21045 bytes 01:00 8 Mar 1990 laser.shar.Z
Again many thanks to all who have responded !!!!!!!!!!!!!!!!!!!!!
Central Institute for Applied Mathematics
Research Center Juelich
Phone: (+49) 2461 / 61- 6586
This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:08:17 CDT