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
Support password-protected PDFs #30
Comments
I'm currently working on supporting encrypted (that is to say password protected) PDF documents. The PDF standard lists various possible algorithms, I will not implement all of them in the next release, but the general framework and the most basic cases should be present. Kind regards, |
I see quite some code for this but I would like to see a small example how to open a password protected pdf-file.
How can I set |
Currently, password-protected PDF documents (reading and/or writing thereof) are not supported. I do have a useful contact from way back when I still worked at another PDF related company. He has already helped me with a bug in I'll see if I can't poke him again. Kind regards, |
Is there an update for password-protected PDF documents? I'm looking forward to an example of that. Thank You |
Update: It should be possible for some of the supported types of password-protected PDF documents to be opened by The following class TestReadEncryptedPDF(TestCase):
def test_open_encrypted_pdf(self):
input_file: Path = self.get_artifacts_directory(True) / "input_001.pdf"
with open(input_file, "rb") as fh:
PDF.loads(fh, password="appeltje")
def test_read_encrypted_pdf(self):
input_file: Path = self.get_artifacts_directory(True) / "input_001.pdf"
# open
l: SimpleTextExtraction = SimpleTextExtraction()
with open(input_file, "rb") as fh:
PDF.loads(fh, password="appeltje", event_listeners=[l])
# compare text
text: str = l.get_text()[0]
assert text.startswith("Video provides a powerful way to help you prove your point.") Which attempts to read the following PDF: Which is protected by the password Kind regards, |
Opening an encrypted PDF without a password (bank statement) results in:
NotImplementedError: password-protected PDFs are currently not supported
This is a TODO mentioned here
The text was updated successfully, but these errors were encountered: