Article View: adobe.postscript.programming
Article #1010Re: Number of Pages in a .ps file
From: Donald Volent
Date: Fri, 23 May 2003 12:02
Date: Fri, 23 May 2003 12:02
35 lines
1991 bytes
1991 bytes
Ok, Aandi,
I checked, and my files ARE DCS compliant, as the top of the file looks like:
%!PS-Adobe-3.0
%%Title: (Microsoft Word - HO04010693.doc)
%%Version: 1 3
%%Creator: (AdobePS5.dll Version 5.2)
%%CreationDate: (D:20021002082804-04'00')
%%DocumentData: Clean7Bit
%%LanguageLevel: 2
%%BoundingBox: 0 0 612 792
%%Pages: 1
Thus, this being so, how would I grab that page count, as it's in a comment(?)
As for your question about where I put the code for counting pages:
I define a PageCount, and an "IncrementPageCount" procedure (which I got from you, incidentally), and I call it from a redefined showpage, like so:
passthrough('/PageCount {1} def')
passthrough('/IncrementPageCount
{/PageCount PageCount 1 add store}
store')
passthrough('/showpage {true
&NoMoreEndorsements eq NumberOfPages
NumberOfPages eq and {PrintLastPsOmr}
{PrintPsOmr} ifelse OmrShow
IncrementPageCount} def')
This is "passed through" in our PlanetPress software in a beginning module, so that when we call the .ps files, the definitions and redefinitions are already resident and kick into action whenever a showpage is encountered.
Thanks,
Don Volent
Technical Details
Message-ID:
<1de93cb1.1@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!cyclone.bc.net!news.maxwell.syr.edu!xmission!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1de93cb1.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10c61a,874e20564ac3d3db X-Google-Attributes: gid10c61a,public X-Google-ArrivalTime: 2003-05-23 05:17:22 PST From: "Donald Volent" <dvolent@thig.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!cyclone.bc.net!news.maxwell.syr.edu!xmission!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.postscript.programming Subject: Re: Number of Pages in a .ps file Message-ID: <1de93cb1.1@WebX.la2eafNXanI> Date: Fri, 23 May 2003 05:02:28 -0700 References: <1de93cb1.-1@WebX.la2eafNXanI> Lines: 42 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit