Open casperbrike opened 1 year ago
The encryption that is specified via /R value of 5 is a proprietary Adobe algorithm that is not specified in the ISO PDF 1.7 or 2.0 standards. Therefore it is not supported at the moment. I may have a look into that at a later time.
Do we have any updates on that?
@vladislav-zubov As stated I may look into this at a later time. I have found a reference for implementation, so it is just a matter when there is time for it.
In the meantime it would be great if an actual PDF that is encrypted with /R 5 is attached to this issue for testing the implementation.
@vladislav-zubov @casperbrike So... "it's just a matter of time"... maybe the time is now - could you try the current version of HexaPDF in the devel branch on a PDF document that fails with the "Invalid /R value 5..." error?
A quick look through the spec of Adobe for that feature that I found suggests that the code in the devel branch might work.
@gettalong Hello, thanks for your answers.
I have tried with the devel branch and it says that incorrect password but a pdf file does not have any passwords installed
HexaPDF::EncryptionError: Invalid password specified
from /usr/local/bundle/bundler/gems/hexapdf-789a377cb6ac/lib/hexapdf/encryption/standard_security_handler.rb:369:in `prepare_decryption'
@vladislav-zubov Could you please provide the PDF to debug this?
@vladislav-zubov I found another small difference between /R 5 and /R 6 and updated the devel branch - could you try again?
@gettalong it works. thanks. Could you bump up a version of the gem?
I'm sorry but before I can release this, I need to properly test it. The changes were just shots in the dark by having quick looks at the spec 😉
I can probably do a release in a week.
@gettalong I'll test with you. I have around 30k documents failed with that error
@vladislav-zubov I found a way to generate the necessary test files for /R 5 and added tests. The changes are live on the devel branch for you to test on your collection of real-world files.
Greetings!
When I try to read a PDF document using the following code:
I get the error:
According to the stacktrace, the error happens here:
My HexaPDF version is 0.30.0.
However, this error is specific to this document, I can read other documents without problems. Could you point out how to read the document correctly, please?
Thanks in advance!