pypdf assert error on documentinfo

T

Tim Arnold

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

===========
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top