On Monday 20 July 2009 07:48:37 pm Carl Karsten wrote:
> On Mon, Jul 20, 2009 at 7:38 PM, John<[email protected]> wrote:
> > On Monday 20 July 2009 05:03:46 pm Carl Karsten wrote:
> >> > anyone know how
> >> > to get a page count from a pdf?
> >>
> >> OK, that's dumb.  Anyone know how I can get the page count from:
> >>
> >>    # generate the pdf in the buffer, using the layout and data
> >>    rw = dReportWriter(OutputFile=buffer, ReportFormFile=xmlfile,
> >> Cursor=ds) rw.write()
> >>
> >> I am not opposed to adding a ABC header and counting the number of
> >> ABC's in the pdf.
> >>
> >> might be nice to add .pagecount to dReportWriter, but that won't help
> >> track down when the good/bad flip happened.
> >
> > A "Improved version"
> > http://code.activestate.com/recipes/576832/
>
> Thanks, but before I found your post I follwed up on a ChiPy post from
>
> just last week:
> >>> from pyPdf import PdfFileWriter, PdfFileReader
> >>> input1 = PdfFileReader(open('test.pdf','rb'))
> >>> print "title = %s" % (input1.getDocumentInfo().title)
>
> title = Dabo Report
>
> >>> print input1.getNumPages()
>
> 3
>
> Now to figure out how to use git bisect...

I like Paul's last post.  It's pure python and appears to work.  No need to 
import anything (other than re).
John


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to