[reportlab-users] Count pages in PDF?

Hancock, David (DHANCOCK) reportlab-users@reportlab.com
Wed, 17 Mar 2004 16:20:36 -0500


Great solution! When I tried it, though, I discovered that (with my version
of GhostScript, at least), I need to tell pd2ps to send its output to
stdout:

	pdf2ps -sOutputFile=- test.pdf | grep -c "%%Page: "

That was the easy part.  Remembering and trying pdf2ps was beyond me until
this posting; THANKS!

Cheers!
--
David Hancock | dhancock@arinc.com | 410-266-4384 


-----Original Message-----
From: Jerome Alet [mailto:alet@librelogiciel.com] 
Sent: Wednesday, March 17, 2004 3:57 PM
To: reportlab-users@reportlab.com
Subject: Re: [reportlab-users] Count pages in PDF?


On Wed, Mar 17, 2004 at 08:42:03PM -0000, Andy Robinson wrote:
> > Is there anything reportlab-ish that can quickly count the number
> > of pages in a PDF?
> >
> > If not, how do people do that?

pdf2ps yourfile.pdf | grep -c "%%Page:"

hth

Jerome Alet
_______________________________________________
reportlab-users mailing list
reportlab-users@reportlab.com
http://two.pairlist.net/mailman/listinfo/reportlab-users