diff --git a/oml/media/pdf.py b/oml/media/pdf.py index 3bf9de5..f32460b 100644 --- a/oml/media/pdf.py +++ b/oml/media/pdf.py @@ -131,7 +131,10 @@ def info(pdf): toc = parse_tableofcontents(pdfreader) if toc: data['tableofcontents'] = toc - info = pdfreader.getDocumentInfo() + try: + info = pdfreader.getDocumentInfo() + except: + info = None if info: for key in info: if info[key]: @@ -144,8 +147,10 @@ def info(pdf): data[key[1:].lower()] = value except: pass - - xmp = pdfreader.getXmpMetadata() + try: + xmp = pdfreader.getXmpMetadata() + except: + xmp = None if xmp: for key in dir(xmp): if key.startswith('dc_'):