Hello, thank you for your response. I tried exactly the same code like yours, but for my large PDF it does not work. Also, I am using the last version of PDFAESStream class (2.9.11b).
This is my code:
PDFAESStream stream = new PDFAESStream();
byte[] key = "MySecretKeyABCDE".getBytes();
stream.open("/sdcard/EncryptedCatalog.pdf", key);
stream.ImportFromFile("/sdcard/Catalog.pdf");
stream.ExportToFile("/sdcard/DecryptedCatalog.pdf");
stream.close();
boolean openStream = stream.open("/sdcard/EncryptedCatalog.pdf", key);
openResult = doc.OpenStream(stream, null);
The variable openStream is true, but openResult is -3.
There are two links to my PDFs (unecrypted and encrypted).
www.dropbox.com/s/ibvnfz6gckr79eb/Catalog.pdf?dl=0
www.dropbox.com/s/uk40gi6zl2uzmnj/EncryptedCatalog.pdf?dl=0
Can you try to open this document, please? The key is MySecretKeyABCDE. Thank you a lot.
UPDATE
I also tried to change the native library. I tried to use the native library from version 3.0beta6, but still I have the same problem.
UPDATE 2
I find out that with class PDFAESStreamOld it works. But there is a problem with writing to the document, because this class supports only "read-only" access.
Update 3
I tried to use PDFAESStream in your demo application, which I found in 3.0beta6 - but still I have the same problem.
Update 4
I tried to use some other large PDF document. I used the 125MB document and with this document my code works. Then, I tried some other document again (61MB) and it does not work - the same problem as above. This 61MB document contains a lot of pictures. Do you think that this could be a reason for error?