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
===========
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
===========