[WinMac] Re: LaserWriter Page Count


Darryl Lee(lee[at]darryl.com)
Thu, 12 Aug 1999 16:46:28 -0500


Romeyn wrote:
> I'm developing a printer page accounting system, and need to count
> the number of PRINTED pages in a postscript file. I intercept this
> file when the client "prints" it, and then send it onto the
> destination printer. Is there any 'form feed' command or 'end of
> page' command I can "count" in a PS document to do this page count?

i just went through a couple of Postscript files i had lying around
and did:

grep Pages filename

i ended up with things like:
%%Pages: 1
%%Pages: 4
%%Pages: 5

Which matched the length of those docs. You'll have to watch out for:
%%Pages: (atend)

i think that might occur at the beginning of a document, telling you
to look for the true number of pages at the end. (How intuitive!) :}

(And it'll probably be safest to grep for %%Pages, in case somebody
actually wrote the word "Pages" in their document.)

-- 
Darryl Lee <lee@darryl.com> | New, yes. But improved? <http://www.darryl.com>

* Windows-MacOS Cooperation List *



This archive was generated by hypermail 2.0b2 on Thu Aug 12 1999 - 14:54:36 PDT