[reportlab-users] Count pages in PDF?

Andy Robinson reportlab-users@reportlab.com
Wed, 17 Mar 2004 20:42:03 -0000

> Is there anything reportlab-ish that can quickly count the number
> of pages in a PDF?
> If not, how do people do that?
> cheers,
> Chris

In PageCatcher, which I know you have a copy of, there are several
ways...the PdfExplorer object is the best as you can dive in
and find text or extract pages easily.

It's not open source though.  If we reach a point where we can
manage fully documented, stable releases of rlextra on all
platforms without a support burden, I'd be happy for this level
of functionality to be used free of charge, but not to open
source the PDF parser.  In the meantime anyone needing this
has to ask nicely for a distro - which Chris already has...

- Andy

>>> from rlextra.pageCatcher.pdfexplorer import PdfExplorer
>>> exp = PdfExplorer('c:\\code\\reportlab\\docs\\userguide.pdf')
>>> exp.pageCount
>>> #and for extra fun...
>>> print exp.getText(2)[0:200]  #0-based page number
bitchin' very high level programming language (which in
exceedingly humble opinions (for
what they are worth) wallops the snot out of all the other contenders (but
your mileage may vary
real soo

> -----Original Message-----
> From: reportlab-users-admin@reportlab.com
> [mailto:reportlab-users-admin@reportlab.com]On Behalf Of Chris Withers
> Sent: 17 March 2004 10:34
> To: reportlab-users@reportlab.com
> Subject: [reportlab-users] Count pages in PDF?
> Hi,
> --
> Simplistix - Content Management, Zope & Python Consulting
>             - http://www.simplistix.co.uk
> _______________________________________________
> reportlab-users mailing list
> reportlab-users@reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users