pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Balaji Venkatamohan <bvenk...@tibco.com>
Subject Re: How to decrypt a PDF document when supplied an owner password
Date Tue, 19 Aug 2014 17:40:50 GMT
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 <andreas@lehmi.de>
wrote:

> Hi,
>
> > Balaji Venkatamohan <bvenkata@tibco.com> 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
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message