I'm trying to unlock a PDF using a password with PDFBox 2.0.0.
In 1.8.11 I was using the PDDocument.openProtection(DecryptionMaterial pm) method but it was removed in 2.0.0 from what I see.
The online documentation does not say how this can be achived in 2.0.0.
The PDF unlocking with password is still possible in PDFBox 2.0.0?
In 2.0, you just call PDDocument.load(file, password)
or PDDocument.load(file)
(if the password is empty). You don't have to call openProtection()
anymore. The load()
of 2.0 call is similar to the loadNonSeq()
call of 1.8.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With