[comp.lang.postscript] Counting the pages of a document

gtir5@fel.tno.nl (Ger R. Timmens) (06/14/91)

Is it possible to count the pages of postscript output
of a document before it is sent to the printer ?
If so, how do I do it ?

Thanks in advance,


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=     Ger Timmens,  Fysisch Elektronisch Laboratorium TNO     =
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=                     _TT    /|    |~                         = 
=                >====ttt===< |   O|   |~                     = 
=                   {_|||_}  \|       O|                      = 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=   Tel.:  070-3264221 tst. 308    @-mail: gtir5@fel.tno.nl   =
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

brown@vidiot.UUCP (Vidiot) (06/16/91)

In article <1991Jun14.075659.1509@fel.tno.nl> gtir5@fel.tno.nl (Ger R. Timmens) writes:
<
<Is it possible to count the pages of postscript output
<of a document before it is sent to the printer ?
<If so, how do I do it ?

If the PostScript file is Document compliant, there will be information in the
file that indicates the total number of pages.

If the PostScript file is hand written, it could be written such that it will
print out hundreds of pages, but only be one line in length.  In this case
you can't, at least not without a PostScript reader to run the job and count
the pages it would put out.
-- 
      harvard\     att!nicmad\          spool.cs.wisc.edu!astroatc!vidiot!brown
Vidiot  ucbvax!uwvax..........!astroatc!vidiot!brown
      rutgers/  decvax!nicmad/ INTERNET:vidiot!brown%astroatc@spool.cs.wisc.edu

raymond@math.berkeley.edu (Raymond Chen) (06/17/91)

In article <1941@vidiot.UUCP>, brown@vidiot (Vidiot) writes:
>If the PostScript file is hand written, it could be written such that it will
>print out hundreds of pages, but only be one line in length.  

Even worse...

    0 1 rand { showpage } for

This one-line Postscript program outputs a random number of pages.
(Don't try this at home, kids!)

cet1@cl.cam.ac.uk (C.E. Thompson) (06/17/91)

In article <1941@vidiot.UUCP> brown@vidiot.UUCP (Vidiot) writes:
>
>If the PostScript file is Document compliant, there will be information in the
>file that indicates the total number of pages.
>
There *may* be. There *usually* will be. If the relevant structure comments
are present, then they will be correct (or the document is not compliant).
But the comments are not mandatory.

Chris Thompson
JANET:    cet1@uk.ac.cam.phx
Internet: cet1%phx.cam.ac.uk@nsfnet-relay.ac.uk