[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: get number of pages of a PostScript file



On Tue, May 01, 2001 at 03:04:41PM +0200, Iwan Mouwen wrote:
> * Rob Mahurin <robm@mad.scientist.com> [010428 23:09]:
> > 10:48 $ psselect -p _1 zeeman.ps > /dev/null 
> > [8] Wrote 1 pages, 86473 bytes
> 
> Shouldn't that be 
>         psselect -p - file.ps > /dev/null 
> instead?
> 
> iwan@samwise:~/tmp$ psselect -p _1 report.ps >/dev/null
> [11] Wrote 1 pages, 68447 bytes
> iwan@samwise:~/tmp$ psselect -p - report.ps >/dev/null
> [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] Wrote 11 pages, 100834 bytes

That also works; the question was how to find out the number of pages
in the document, though, so I only care about the last number.  You
could even do

16:28 $ psselect -p _1 xray.ps 2>&1 > /dev/null | tr "[]" "\n\n" | grep ^[0-9]
8

although I'm sure there's a more elegant way.

Rob

-- 
"Text processing has made it possible to right-justify any idea, even
one which cannot be justified on any other grounds."
		-- J. Finnegan, USC.



Reply to: