PyPDF 2 Decrypt Not Working

前端 未结 7 1255
悲哀的现实
悲哀的现实 2020-12-15 20:38

Currently I am using the PyPDF 2 as a dependency.

I have encountered some encrypted files and handled them as you normally would (in the following code):

<         


        
7条回答
  •  死守一世寂寞
    2020-12-15 21:09

    This error may come about due to 128-bit AES encryption on the pdf, see Query - is there a way to bypass security restrictions on a pdf?

    One workaround is to decrypt all isEncrypted pdfs with "qpdf"

    qpdf --password='' --decrypt input.pdf output.pdf
    

    Even if your PDF does not appear password protected, it may still be encrypted with no password. The above snippet assumes this is the case.

提交回复
热议问题