Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!helios!skdutta From: skdutta@cs.tamu.edu (Saumen K Dutta) Newsgroups: comp.lang.postscript Subject: Re: PostScript page counter? Message-ID: <6988@helios.TAMU.EDU> Date: 30 Jul 90 21:23:06 GMT References: <1990Jul26.173633.13911@msuinfo.cl.msu.edu> <1990Jul30.153325.15342@zoo.toronto.edu> <1990Jul30.181713.29483@phri.nyu.edu> Sender: usenet@helios.TAMU.EDU Organization: Computer Science Department, Texas A&M University Lines: 33 tdd@convex.cl.msu.edu (Thomas D. Davis) wants: >> software that will read a PostScript file and do nothing more >> than determine the number of pages it will print. henry@zoo.toronto.edu (Henry Spencer) says: > Basically, it can't be done [...] read the printer's page count before > and after, and subtract -- *it* knows how many pages it printed. roy@phri.nyu.edu (Roy Smith) writes: > An alternative approach >is to simply look for a "%Pages" line in the PS file and use the number >therein. The vast majority of PS-producing programs know how many pages >they intend to print (and indeed will print), and are well-behaved enough >to supply this count for people to use as a PS comment. > > Of course, if you go this route, you have to understand that the >%Pages line might be missing, or wrong (either through accident or >mailicious intent by somebody trying to avoid paying per-page printing >charges). Use it at your own peril. If you think there could be problems with the %Pages in postscript file due no non-conformance of standards or suspecting malicious intent you could also check up for the control character ^L in the postscript file which is usually used for pagebreak -- _ ||Internet: skdutta@cssun.tamu.edu ( /_ _ / --/-/- _ ||Bitnet : skd8107@tamvenus.bitnet __)_/(_____(_/_(_/_(_(__(_/_______ ||Uucp : uunet!cssun.tamu.edu!skdutta .. ||Yellnet: (409) 846-8803