🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #3861

Re: counting pages?

#3861
From: Vidiot
Date: Sun, 27 Sep 1992 18:40
23 lines
1550 bytes
In article <Bv7H2A.6Kt@mtholyoke.edu> jbotz@mtholyoke.edu (Jurgen Botz) writes:
<Are there any programs that will take a postscript file as input
<and return the number of pages?  I know this is non-trivial, and
<yes, I know I can count pages by getting the page count from the
<printer before and after printing a document, but I need a way to
<predict how many pages a printjob is going to take in advance.

Gee, here we go again :-)

If the PostScript file is DSC compliant, just grep for "Pages:"

If the document is not DSC compliant, then no it isn't easy.  You have to
interpret the PostScript program and have it report to you a page count.
I think someone mentioned that GhostScript might work for that.

But, keep in mind that someone could send a single line piece of PostScript
code to the printer that could print a different number of pages each time
it is executed.
-- 
      harvard\                          spool.cs.wisc.edu!astroatc!vidiot!brown
Vidiot  ucbvax!uwvax..........!astroatc!vidiot!brown
      rutgers/            INTERNET:vidiot!brown%astroatc.UUCP@spool.cs.wisc.edu
                                   brown@wi.extrel.com
Technical Details
Message-ID: <4171@vidiot.UUCP>
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!think.com!rpi!uwm.edu!rutgers!uwvax!astroatc!vidiot!brown
References: <Bv7H2A.6Kt@mtholyoke.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!think.com!rpi!uwm.edu!rutgers!uwvax!astroatc!vidiot!brown
From: brown@vidiot.UUCP (Vidiot)
Newsgroups: comp.lang.postscript
Subject: Re: counting pages?
Message-ID: <4171@vidiot.UUCP>
Date: 27 Sep 92 18:40:30 GMT
References: <Bv7H2A.6Kt@mtholyoke.edu>
Reply-To: brown@vidiot.UUCP (Vidiot)
Organization: Vidiot's Hangout
Lines: 23