try to decrypt pdf with empty password if its encrypted
This commit is contained in:
parent
9304d14c5f
commit
c6c8e0dc8a
1 changed files with 3 additions and 1 deletions
|
@ -101,12 +101,14 @@ def info(pdf):
|
|||
try:
|
||||
pdfreader = PdfFileReader(fd)
|
||||
data['pages'] = pdfreader.numPages
|
||||
if pdfreader.getIsEncrypted():
|
||||
pdfreader.decrypt('')
|
||||
info = pdfreader.getDocumentInfo()
|
||||
if info:
|
||||
for key in info:
|
||||
if info[key]:
|
||||
data[key[1:].lower()] = info[key]
|
||||
xmp =pdfreader.getXmpMetadata()
|
||||
xmp = pdfreader.getXmpMetadata()
|
||||
if xmp:
|
||||
for key in dir(xmp):
|
||||
if key.startswith('dc_'):
|
||||
|
|
Loading…
Reference in a new issue