🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #6633

Re: number of pages

#6633
From: James Casey
Date: Mon, 11 Jan 1993 12:56
37 lines
1864 bytes
>In article <4749@vidiot.UUCP> brown@vidiot.UUCP (Vidiot) writes:
>>In article <1993Jan8.172822.12211@wavehh.hanse.de> cracauer@wavehh.hanse.de (Martin Cracauer) writes:
>><I an using:

>><grep "Page: " | wc

>And what if your document also has the text "Page:" in it somewhere?
>Please, use

>	grep '^%%Page:' | wc

>Even that won't work if you're working with nested documents which
>may have embedded (but igonred) %%Page directives too.

>>If the PostScript file was DSC compliant, then "grep %%Pages:" would be
>>enough.  If you get back nothing, then it was either a one page document
>>(where the %%Pages wasn't necessary) or it wasn't DSC compliant, which means
>>that the grep idea won't work.

>I've seen supposedly DSC compliant code emitting %%Page, but not %%Pages:.
>Somestimes a "%%Pages: (atend)", but forgot to do the real one at the end...

>It's simple enough to try both and see what comes out.

>Not very reliable tho.

More reliable-- use ghostscript... Someone on our site hacked it to return
number of pages printed... It was easy enough to do. It comes with a dummy 
driver supplied. He added a global in main,and added code in printpage which 
increments the global every time a page is printed, and before exiting returns
total number of pages printed. He says he will post diffs if anyone is 
interested.

james.
-- 
--
james.
Technical Details
Message-ID: <1993Jan11.125627.27906@maths.tcd.ie>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!ieunet!tcdcs!maths.tcd.ie!jcasey
References: <1993Jan6.163958.27417@hubcap.clemson.edu> <1993Jan8.172822.12211@wavehh.hanse.de> <4749@vidiot.UUCP> <4119@ecicrl.ocunix.on.ca>

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.postscript
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!ieunet!tcdcs!maths.tcd.ie!jcasey
From: jcasey@maths.tcd.ie (James Casey)
Subject: Re: number of pages
Message-ID: <1993Jan11.125627.27906@maths.tcd.ie>
Organization: Dept. of Maths, Trinity College, Dublin, Ireland.
References: <1993Jan6.163958.27417@hubcap.clemson.edu> <1993Jan8.172822.12211@wavehh.hanse.de> <4749@vidiot.UUCP> <4119@ecicrl.ocunix.on.ca>
Date: Mon, 11 Jan 1993 12:56:27 GMT
Lines: 37