-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"file has not been decrypted" error #51
Comments
I think I had a similar issue. Can you try:
This may be related to this issue outlined here: |
Great! It worked. Thank you. I should have researched a little more before filing a bug report. |
Work around for PDFs which behave as if decrypted, though were encrypted without a password.
Work around for PDFs which behave as if decrypted, though were encrypted without a password.
Fix "file has not been decrypted" error #51.
I am using the trick:
However, some PDFs crash the script with the following traceback:
This is not normal, I would expect a return value from decrypt(), not an exception... |
To clarify I'm using version pyPdf==1.13 |
workaround applied as described below: py-pdf/pypdf#51 https://bugs.launchpad.net/pypdf/+bug/355479 Signed-off-by: Yannick Gicquel <ygicquel@gmail.com>
input.decrypt('') PyPDF2==1.26.0 |
This works for me. Surprisingly I don't need it, when I run my script in the debugger step by step. Maybe this works in the sense of a sleep function. |
@istommao did you ever find a solution? I am having the same issue. |
I have the same error, when I try to read an unencrypted file. If I try to run input.decrypt(''), I get the error NotImplementedError: only algorithm code 1 and 2 are supported |
I am having the issue I am reading an unencrypted file. If I try to run input.decrypt(''), I get the error NotImplementedError: only algorithm code 1 and 2 are supported |
@Hussam1 were you able to find a solution? I'm facing the same issue. |
I think I solve the issue. I unlocked the pdf using: https://smallpdf.com/unlock-pdf However, when I run Not sure if it has anything to do with this or if the pdf was just poorly made from the start. --Edit I was using the wrong method, I really wanted .getFormTextFields(), and it worked just fine, so this really did do the trick for me. |
Exception occurs when reading certain valid pdfs
File "/usr/local/lib/python2.7/dist-packages/PyPDF2/pdf.py", line 1019, in getObject
raise Exception, "file has not been decrypted"
PDF: http://dis.puc.state.oh.us/ViewImage.aspx?CMID=A1001001A13L20B64142B89320
The text was updated successfully, but these errors were encountered: