Zhi Ren wrote:
Hi, Bruno,
Thanks!
So, if isEncrypted() return true, it is user-password
protected.
It's not that simple.
Please read the PDF Reference on user/owner passwords.
But, in iText there are only constructors
which take ownerPassword as input like:
PdfReader(String filename, byte[] ownerPassword).
Indeed: a user password is the password the end-user needs
to view the PDF.
An owner password is what a program needs to manipulate
the document.
If you understand the difference, you understand why there
is no method that takes the user password.
So
my question is:
How to open a user-password-protected pdf file in
iText?
That's the whole idea of protection: you need the owner
password to do this. Otherwise you could remove the
permissions by entering the user password only. What
would then be the point of having an owner password?
My other question is: in iText how do we know if there
is a owner-password in a pdf file?
My understand is: even there is a owner-password, we
can still open and edit (do whatever we want on) a pdf
file with iText, am I right?
If you know the owner password, you use it to in PdfReader;
you don't need the user password if you have the owner password.
Anyway: you should read what the PDF Reference says on passwords.
br,
Bruno
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions