Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!ginosko!usc!snorkelwacker!bloom-beacon!eru!luth!sunic!tut!tukki!sakkinen From: sakkinen@tukki.jyu.fi (Markku Sakkinen) Newsgroups: comp.lang.postscript Subject: Re: How do you count the number of pages in a postscript document? Message-ID: <1517@tukki.jyu.fi> Date: 16 Oct 89 07:59:39 GMT References: <1955@cunixc.cc.columbia.edu> Reply-To: sakkinen@jytko.jyu.fi (Markku Sakkinen) SAKKINEN@FINJYU.bitnet (alternative) Organization: University of Jyvaskyla, Finland Lines: 26 In article <1955@cunixc.cc.columbia.edu> seth@cunixc.cc.columbia.edu (Seth Strumph) writes: > >does anyone have (or know of) a program that will count the number of >printed pages that an arbitrary postscript file (including those ^^^^^^^^^ >created on a macintosh) will generate? Theoretically impossible! Since PostScript is a "Turing-equivalent" language (i.e. a full-powered programming language), even the termination of an _arbitrary_ PS programme (file) is undecidable. The only way to find out is a rather complete emulator or interpreter. And you still have problems with possibly nonterminating programmes. However, PostScript code generated by text processors and similar application software should be very well-behaving. Indeed, if it conforms to the structuring conventions recommended by Adobe, such things as the number of pages are given in special comments at the beginning or end of the file. Markku Sakkinen Department of Computer Science University of Jyvaskyla (a's with umlauts) Seminaarinkatu 15 SF-40100 Jyvaskyla (umlauts again) Finland