Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!wuarchive!gem.mps.ohio-state.edu!uakari.primate.wisc.edu!caesar.cs.montana.edu!ogccse!cvedc!nosun!tektronix!sequent!ccssrv!perry From: perry@ccssrv.UUCP (Perry Hutchison) Newsgroups: comp.lang.postscript Subject: Re: PS page counter Message-ID: <817@ccssrv.UUCP> Date: 11 Nov 89 02:46:26 GMT References: <1consult@physc1.byu.edu> Reply-To: perry@ccssrv.UUCP (Perry Hutchison) Organization: Control-C Software, Inc., Beaverton, OR Lines: 19 In article <1consult@physc1.byu.edu> consult@physc1.byu.edu writes: > I am looking for a (simple?) algorithm to count pages in a postscript file. This is becoming a frequently-asked question in this group. Trying to do this by inspection is a lot like trying to estimate the size of a C program's output by examining the source code. (PostScript is very much a programming language.) To do this reliably on the host system, you would have to write a PostScript interpreter. For accounting purposes (as opposed to setting print queue priority based on job size), an after-the-fact count may be acceptable. It has the advantages of being relatively simple to implement and also fairly secure. The LaserWriter (and presumably most other PostScript printers) have a host-readable counter which shows how many pages have ever been printed by this printer. You can read that counter before and after each job, and charge accordingly.