Skip to content
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

A PDF file that can't be processed #1

Open
superflexible opened this issue Feb 10, 2024 · 4 comments
Open

A PDF file that can't be processed #1

superflexible opened this issue Feb 10, 2024 · 4 comments

Comments

@superflexible
Copy link

Example.pdf
Hello,
many thanks for providing this code!

I have a few PDF files that throw a decompression error, although the files are valid and can be viewed fine. I don't think they are encrypted.

I am attaching an example.

Do you think it can be fixed?

Many thanks.
Tobias

@superflexible
Copy link
Author

Apparently it is encrypted but without a password or something like that?

Can a workaround somehow be found?

@AngusJohnson
Copy link
Owner

Hi Tobias.
Yes it is encrypted (to limit copy permissions) even though no password is required.
And unfortunately decryption isn't currently supported because it adds a whole new level of complexity.
Nevertheless I've just updated the repository so we're a bit closer to accomplishing this, but there's still quite a way to go. And unfortunately for you, I'm very tied up with another project. Of course you're welcome to contribute decrypt code (since I've mostly covered the PDF specific stuff) but I won't be spending much time on this myself any time soon. Sorry to disappoint.

@superflexible
Copy link
Author

superflexible commented Feb 12, 2024

Hi Angus,
no problem at all, thanks for the information! Maybe I'll have a go at decryption. I worked with AES256 a lot, but of course it would add dependency on another library, or maybe something that ships with Delphi.

@AngusJohnson
Copy link
Owner

AngusJohnson commented Feb 12, 2024

worked with AES256 a lot, but of course it would add dependency on another library, or maybe something that ships with Delphi.

The following code seems to have a very permissive license 😜:
https://github.com/stijnsanders/tools/blob/master/crypto/aes.pas

Edit: And adding Cipher Block Chaining that's also needed shouldn't be too difficult.

See also Encryption (Section 3.5) in the PDF Reference Doc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants