Comment 0 for bug 242755

Revision history for this message
Mathieu Fenniak (mfenniak) wrote :

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
              #raise utils.PdfReadError, "multiple definitions in dictionary"
          else:
              data[key] = value