pypdf assert error on documentinfo

Tim Arnold tiarno at
Thu Jun 28 16:57:47 CEST 2007

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 ====
import pyPdf
filename = 'test.pdf'
test= pyPdf.PdfFileReader(open(filename,'rb'))
print test.getNumPages()
tmp = test.getDocumentInfo()

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


More information about the Python-list mailing list