count pages in a pdf

Andreas Lobinger newsreturns at biszumknie.de
Tue Nov 27 12:25:52 EST 2007


Tim Golden wrote:
> belred at gmail.com wrote:
> 
>> is it possible to parse a pdf file in python?  for starters, i would
>> like to count the number of pages in a pdf file.  i see there is a
>> project called ReportLab, but it seems to be a pdf generator... i
>> can't tell if i would be able to parse a pdf file programmically.

http://groups.google.de/group/comp.lang.python/msg/6f304970b4ff40ce
and following.

> Well the simple expedient of putting "python count pages pdf" into
> Google turned up the following link:
> 
> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496837

mmmmh. There is a non-vanishing possibility that this pattern-
matching can give you false positives -> not reliable.

Wishing a happy day,
		LOBI



More information about the Python-list mailing list