|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pdfbox.pdmodel.encryption.AccessPermission
public class AccessPermission
This class represents the access permissions to a document. These permissions are specified in the PDF format specifications, they include:
ProtectionPolicy
,
PDDocument.getCurrentAccessPermission()
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
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). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AccessPermission()
public AccessPermission(byte[] b)
b
- the bytes as defined in PDF specspublic AccessPermission(int permissions)
permissions
- The permission bits.Method Detail |
---|
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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |