Multiple DocumentInfo keys
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PDF-Shuffler |
New
|
Undecided
|
Unassigned | ||
pyPdf |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Originally reported via e-mail from Robert Boulanger:
I'm using your PyPDF Library specially for cataloging pdf files. When reading the DocumentInfos (Metadata, it often happens, that pdf's have the same keys multiple times.
In this case your lib raises an error, since multible keys are not permitted.
Wouldn't it be better to just skip the additional key/value pairs instead of raising an error ?
I changed generic.py in line 492 as follows:
if data.has_key(key):
# multiple definitions of key not permitted
pass
else:
=======
Just adding that I too had to make the same change. I create pdf files with pdflatex using hyperref. Some of my pdfs could not be opened by pyPdf, although some could be opened with no problem (all generated using the same workflow). In any case, this modification made it possible to open all of my pdfs.
I think it should be considered for adding to the real distribution.
thanks,
--Tim Arnold
thanks! this is great, i had trouble opening some pdfs but this fixed the issue.