org.apache.pdfbox.pdmodel.encryption
public class: StandardProtectionPolicy [javadoc |
source]
java.lang.Object
org.apache.pdfbox.pdmodel.encryption.ProtectionPolicy
org.apache.pdfbox.pdmodel.encryption.StandardProtectionPolicy
This class represents the protection policy to add to a document
for password-based protection.
The following example shows how to protect a PDF document with password.
In this example, the document will be protected so that someone opening
the document with the user password
user_pwd
will not be
able to modify the document.
AccessPermission ap = new AccessPermission();
ap.setCanModify(false);
StandardProtectionPolicy policy = new StandardProtectionPolicy(owner_pwd, user_pwd, ap);
doc.protect(policy);
- author:
Benoit
- Guillon (benoit.guillon@snv.jussieu.fr)
- version:
$
- Revision: 1.3 $
Constructor: |
public StandardProtectionPolicy(String ownerPass,
String userPass,
AccessPermission perms) {
this.permissions = perms;
this.userPassword = userPass;
this.ownerPassword = ownerPass;
}
Creates an new instance of the standard protection policy
in order to protect a PDF document with passwords. Parameters:
ownerPass - The owner's password.
userPass - The users's password.
perms - The access permissions given to the user.
|
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |