Hi Andreas,
Thank you for your reply. I have tried using
document.decrypt("ownerORuser_password");
in my code. The above API call works if we provide the user password to
decrypt an encrypted PDF but when I give the owner password for the same
PDF, the API is not able to validate the password correctly and it never
recognizes the owner password. When I try opening that PDF from the file
system, the owner password and the user password work.
Thanks,
Balaji
On Tue, Aug 19, 2014 at 3:07 AM, Andreas Lehmkühler <[email protected]>
wrote:
> Hi,
>
> > Balaji Venkatamohan <[email protected]> hat am 18. August 2014 um 23:33
> > geschrieben:
> >
> >
> > I want to know if PdfBox provides an option to decrypt a PDF document
> given
> > its owner password and not its user password?
> >
> > I use :
> >
> > DecryptionMaterial decryptionMaterial = new
> > StandardDecryptionMaterial("owner_password");
> > document.openProtection(decryptionMaterial);
> >
> > I searched the net but could not find a matching issue. If it is a repeat
> > question and if there already exists a solution to this, please provide
> me
> > the link to the issue.
> You should simply use something like the following:
>
> document.decrypt("owner_password");
>
> > Thanks,
> > Balaji
>
> BR
> Andreas Lehmkühler
>