Path: utzoo!attcan!uunet!snorkelwacker!usc!cs.utexas.edu!yale!cmcl2!phri!roy From: roy@phri.nyu.edu (Roy Smith) Newsgroups: comp.lang.postscript Subject: Re: PostScript page counter? Message-ID: <1990Jul30.181713.29483@phri.nyu.edu> Date: 30 Jul 90 18:17:13 GMT References: <1990Jul26.173633.13911@msuinfo.cl.msu.edu> <1990Jul30.153325.15342@zoo.toronto.edu> Sender: news@phri.nyu.edu (News System) Organization: Public Health Research Institute, New York City Lines: 25 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. While Henry's answer is certainly the correct one, it is also almost certainly not the one Thomas wants to hear. 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. -- Roy Smith, Public Health Research Institute 455 First Avenue, New York, NY 10016 roy@alanine.phri.nyu.edu -OR- {att,cmcl2,rutgers,hombre}!phri!roy "Arcane? Did you say arcane? It wouldn't be Unix if it wasn't arcane!"