public class AccessPermission extends Object
ProtectionPolicy
,
PDDocument.getCurrentAccessPermission()
Constructor and Description |
---|
AccessPermission()
Create a new access permission object.
|
AccessPermission(byte[] b)
Create a new access permission object from a byte array.
|
AccessPermission(int permissions)
Creates a new access permission object from a single integer.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canAssembleDocument()
This will tell if the user can insert/rotate/delete pages.
|
boolean |
canExtractContent()
This will tell if the user can extract text and images from the PDF document.
|
boolean |
canExtractForAccessibility()
This will tell if the user can extract text and images from the PDF document
for accessibility purposes.
|
boolean |
canFillInForm()
This will tell if the user can fill in interactive forms.
|
boolean |
canModify()
This will tell if the user can modify contents of the document.
|
boolean |
canModifyAnnotations()
This will tell if the user can add/modify text annotations, fill in interactive forms fields.
|
boolean |
canPrint()
This will tell if the user can print.
|
boolean |
canPrintDegraded()
This will tell if the user can print the document in a degraded format.
|
static AccessPermission |
getOwnerAccessPermission()
returns an access permission object for a document owner.
|
int |
getPermissionBytes()
The returns an integer representing the access permissions.
|
int |
getPermissionBytesForPublicKey()
This returns an integer representing the access permissions.
|
protected boolean |
hasAnyRevision3PermissionSet()
Indicates if any revision 3 access permission is set or not.
|
boolean |
isOwnerPermission()
This will tell if the access permission corresponds to owner
access permission (no restriction).
|
boolean |
isReadOnly()
This will tell if the object has been set as read only.
|
void |
setCanAssembleDocument(boolean allowAssembly)
Set if the user can insert/rotate/delete pages.
|
void |
setCanExtractContent(boolean allowExtraction)
Set if the user can extract content from the document.
|
void |
setCanExtractForAccessibility(boolean allowExtraction)
Set if the user can extract content from the document for accessibility purposes.
|
void |
setCanFillInForm(boolean allowFillingInForm)
Set if the user can fill in interactive forms.
|
void |
setCanModify(boolean allowModifications)
Set if the user can modify the document.
|
void |
setCanModifyAnnotations(boolean allowAnnotationModification)
Set if the user can modify annotations.
|
void |
setCanPrint(boolean allowPrinting)
Set if the user can print.
|
void |
setCanPrintDegraded(boolean allowAssembly)
Set if the user can print the document in a degraded format.
|
void |
setReadOnly()
Locks the access permission read only (ie, the setters will have no effects).
|
public AccessPermission()
public AccessPermission(byte[] b)
b
- the bytes as defined in PDF specspublic AccessPermission(int permissions)
permissions
- The permission bits.public boolean isOwnerPermission()
public static AccessPermission getOwnerAccessPermission()
public int getPermissionBytesForPublicKey()
public int getPermissionBytes()
public boolean canPrint()
public void setCanPrint(boolean allowPrinting)
allowPrinting
- A boolean determining if the user can print.public boolean canModify()
public void setCanModify(boolean allowModifications)
allowModifications
- A boolean determining if the user can modify the document.public boolean canExtractContent()
public void setCanExtractContent(boolean allowExtraction)
allowExtraction
- A boolean determining if the user can extract content
from the document.public boolean canModifyAnnotations()
public void setCanModifyAnnotations(boolean allowAnnotationModification)
allowAnnotationModification
- A boolean determining if the user can modify annotations.public boolean canFillInForm()
public void setCanFillInForm(boolean allowFillingInForm)
allowFillingInForm
- A boolean determining if the user can fill in interactive forms.public boolean canExtractForAccessibility()
public void setCanExtractForAccessibility(boolean allowExtraction)
allowExtraction
- A boolean determining if the user can extract content
from the document.public boolean canAssembleDocument()
public void setCanAssembleDocument(boolean allowAssembly)
allowAssembly
- A boolean determining if the user can assemble the document.public boolean canPrintDegraded()
public void setCanPrintDegraded(boolean allowAssembly)
allowAssembly
- A boolean determining if the user can print the
document in a degraded format.public void setReadOnly()
public boolean isReadOnly()
protected boolean hasAnyRevision3PermissionSet()
Copyright © 2002–2016 The Apache Software Foundation. All rights reserved.