[comp.laser-printers] Counting PostScript Pages

jlg@UNCCVAX.UNCC.EDU (john l grant) (03/14/91)

Does anyone have a filter program that will count Postscript
pages before the file goes to the printer?  I've taken a quick 
look at the Postscript language and believe such a program would 
be possible.  It's certainly more involved that looking at the 
size of the file, but definately possible.

I'm looking for a way to do some accounting on printer usage.  If
anyone has any total package solutions I would be interested in
hearing about them.

John Grant

jlg@unccvax.uncc.edu

kludge@GRISSOM.LARC.NASA.GOV (Scott Dorsey) (03/14/91)

In article <9103132037.AA25632@crayola.cs.UMD.EDU> jlg@UNCCVAX.UNCC.EDU (john l grant) writes:
>
>Does anyone have a filter program that will count Postscript
>pages before the file goes to the printer?  I've taken a quick 
>look at the Postscript language and believe such a program would 
>be possible.  It's certainly more involved that looking at the 
>size of the file, but definately possible.

how about
   egrep showpage | wc -l

Crude but fairly efficient.
--scott

amichiel@RODAN.ACS.SYR.EDU (Allen J Michielsen) (03/16/91)

<9103141524.AA00940@crayola.cs.UMD.EDU> kludge@GRISSOM.LARC.NASA.GOV 
(Scott Dorsey) writes:
>In article <9103132037.AA25632@crayola.cs.UMD.EDU> jlg@UNCCVAX.UNCC.EDU 
(john l grant) writes:
>>Does anyone have a filter program that will count Postscript
>>pages before the file goes to the printer?  I've taken a quick 

>how about
>   egrep showpage | wc -l
>Crude but fairly efficient.

I don't suppose this crude but fairly efficient model works too well when
using copypage or when showpage has been logically defined as sp or when
.....
al



-- 
Al. Michielsen, Mechanical & Aerospace Engineering, Syracuse University
 InterNet: amichiel@rodan.acs.syr.edu  amichiel@sunrise.acs.syr.edu
 Bitnet: AMICHIEL@SUNRISE 

sun@ME.UTORONTO.CA (Andy Sun Anu-guest) (03/16/91)

kludge@GRISSOM.LARC.NASA.GOV (Scott Dorsey) writes:

>In article <9103132037.AA25632@crayola.cs.UMD.EDU> jlg@UNCCVAX.UNCC.EDU (john l grant) writes:
>>
>>Does anyone have a filter program that will count Postscript
>>pages before the file goes to the printer?  I've taken a quick 
>>look at the Postscript language and believe such a program would 
>>be possible.  It's certainly more involved that looking at the 
>>size of the file, but definately possible.

>how about
>   egrep showpage | wc -l

>Crude but fairly efficient.
>--scott

The above will probably not work in most cases, unless we are dealing with
home-made PostScript programs. Almost all PostScript drivers, be they
PC, Macintosh, or Unix-based, do not use showpage explicitly. Instead,
it is buried somewhere in the prologue definitions. You will probably
end up with a 1 all the time if you use the above. By the way, some
drivers uses the combination of copypage and erasepage, so checking for
showpage is usually not sufficient. Of course if you can garantee that users
are always printing from a particular software with a particular prologue
definition, you can sort of jury-rig something just for that format.

Andy

_______________________________________________________________________________
Andy Sun                            | Internet: sun@me.utoronto.ca
University of Toronto, Canada       | UUCP    : ...!utai!me!sun
Dept. of Mechanical Engineering     | BITNET  : sun@me.utoronto.BITNET

pollack@CIS.OHIO-STATE.EDU (Jordan B Pollack) (03/17/91)

STATIC counting of showpage will not work, because it if often used
once, in a definition like "P" or "E".  "Conforming" postscript can be
counted with "%%Page", but tricky users who don't wish to pay $.15 per
page will delete them.

The best way is to use a postscript interpreter, or an old laserwriter
printer, with a program like the "distillery" which redefines every
drawing primitive and just counts DYNAMIC calls to showpage.

--
Jordan Pollack                            Assistant Professor
CIS Dept/OSU                              Laboratory for AI Research
2036 Neil Ave                             Email: pollack@cis.ohio-state.edu
Columbus, OH 43210                        Fax/Phone: (614) 292-4890

HEISZJ@QUCDN.QUEENSU.CA (03/22/91)

  Sometime ago I wrote a package for doing PostScript accounting for
our local network of SUN workstations.  It is a somewhat (?)
intelligent PostScript parser, which attempts to keep track of
redefinitions of the showpage command, and the counts the number
of occurences of page ejections.  It can be defeated by someone
who is knowledgeable in PostScript and knows how the program parses
its input, but for most of the outputs we tested here it appeared to
work properly.  There is also a rudimentary accounting package
designed to mail usage summaries to individual users and the machine
root.  I'll dig it up and make it available by anonymous ftp ate
sparky.phy.queensu.ca.

   It does have one notorious bug. It doesn't know whether the
laserprinter actually printed the pages or not.  We now use the
laser program (available from titan.rice.edu, I believe) which
queries our Laserwriter for the exact number of pages printed.  If
your printer can do this you might want to check it out.

   If you wish to get in touch with me, please use the address below
as I only use this account occasionally to read news.

                                        Jeff Heisz

-----------------------------------------------------------------------------
Jeff Heisz                   |Internet: heisz@sparky.phy.queensu.ca
Department of Physics        |
Queen's University, Kingston, Canada

mezger@DIA.INFORMATIK.UNI-STUTTGART.DE (Kai Martin Mezger) (03/26/91)

>  Sometime ago I wrote a package for doing PostScript accounting for
>  our local network of SUN workstations.  It is a somewhat (?)
....stuff deleted

But is there at least a PRODUCT for the good ol' Mac (networked) ?

Martin
--

+-----------------------------------------------------------------------------+
|Kai Martin Mezger          BITNET: mezger%dia%ifistg@unido.bitnet,	      |
|				 or MEZGER AT DS0LILOG.BITNET	              |
|Student 		     local: mezger@dia				      |
|Universitaet Stuttgart       UUCP: ...!uunet!unido!ifistg!dia!mezger         |
|BR Deutschland	          Internet: mezger@dia.informatik.uni-stuttgart.de    |
|		     X.400: mezger@dia.ifi.informatik.uni-stuttgart.dbp.de    |
+-----------------------------------------------------------------------------+