FAQ
Using pyPdf, nice user interface. Maybe it doesn't handle pdf 1.4? I'm
getting an assertion error from the following code. The pdf file shows it
does have a title in its document info (using acrobat 8 or reader 5).

pdf is version 1.4, produced with pdfeTex (pdflatex) 1.304
using python 2.4.1

#==== file test.py ====
import pyPdf
filename = 'test.pdf'
test= pyPdf.PdfFileReader(open(filename,'rb'))
print test.getNumPages()
tmp = test.getDocumentInfo()

===========
python test.py
55
Traceback (most recent call last):
File "test.py", line 6, in ?
tmp = test.getDocumentInfo()
File "tiarno/pyPdf-1.9/pyPdf/pdf.py", line 291, in getDocumentInfo
obj = self.getObject(self.trailer['/Info'])
File "tiarno/pyPdf-1.9/pyPdf/pdf.py", line 407, in getObject
retval = readObject(self.stream, self)
File "tiarno/pyPdf-1.9/pyPdf/generic.py", line 64, in readObject
return DictionaryObject.readFromStream(stream, pdf)
File "tiarno/pyPdf-1.9/pyPdf/generic.py", line 348, in readFromStream
assert False
AssertionError

===========

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedJun 28, '07 at 2:57p
activeJun 28, '07 at 2:57p
posts1
users1
websitepython.org

1 user in discussion

Tim Arnold: 1 post

People

Translate

site design / logo © 2022 Grokbase