This class holds information that is related to the standard PDF encryption.
See PDF Reference 1.4 section "3.5 Encryption"
DEFAULT_PERMISSIONS
public static final int DEFAULT_PERMISSIONS
The default set of permissions which is to allow all.
DEFAULT_REVISION
public static final int DEFAULT_REVISION
The default revision of one is not specified.
FILTER_NAME
public static final String FILTER_NAME
The 'Filter' name for this security handler.
REVISION2
public static final int REVISION2
Encryption revision 2.
REVISION3
public static final int REVISION3
Encryption revision 3.
REVISION4
public static final int REVISION4
Encryption revision 4.
canAssembleDocument
public boolean canAssembleDocument()
This will tell if the user can insert/rotate/delete pages.
- true If supplied with the user password they are allowed to extract content
from the PDF document
canExtractContent
public boolean canExtractContent()
This will tell if the user can extract text and images from the PDF document.
- true If supplied with the user password they are allowed to extract content
from the PDF document
canExtractForAccessibility
public boolean canExtractForAccessibility()
This will tell if the user can extract text and images from the PDF document
for accessibility purposes.
- true If supplied with the user password they are allowed to extract content
from the PDF document
canFillInForm
public boolean canFillInForm()
This will tell if the user can fill in interactive forms.
- true If supplied with the user password they are allowed to fill in form fields.
canModify
public boolean canModify()
This will tell if the user can modify contents of the document.
- true If supplied with the user password they are allowed to modify the document
canModifyAnnotations
public boolean canModifyAnnotations()
This will tell if the user can add/modify text annotations, fill in interactive forms fields.
- true If supplied with the user password they are allowed to modify annotations.
canPrint
public boolean canPrint()
This will tell if the user can print.
- true If supplied with the user password they are allowed to print.
canPrintDegraded
public boolean canPrintDegraded()
This will tell if the user can print the document in a degraded format.
- true If supplied with the user password they are allowed to print the
document in a degraded format.
getOwnerKey
public byte[] getOwnerKey()
This will get the O entry in the standard encryption dictionary.
- getOwnerKey in interface PDEncryptionDictionary
- A 32 byte array or null if there is no owner key.
getRevision
public int getRevision()
This will return the R entry of the encryption dictionary.
See PDF Reference 1.4 Table 3.14.
- getRevision in interface PDEncryptionDictionary
- The encryption revision to use.
getUserKey
public byte[] getUserKey()
This will get the U entry in the standard encryption dictionary.
- getUserKey in interface PDEncryptionDictionary
- A 32 byte array or null if there is no user key.
setCanAssembleDocument
public void setCanAssembleDocument(boolean allowAssembly)
Set if the user can insert/rotate/delete pages.
allowAssembly
- A boolean determining if the user can assemble the document.
setCanExtractContent
public void setCanExtractContent(boolean allowExtraction)
Set if the user can extract content from the document.
allowExtraction
- A boolean determining if the user can extract content
from the document.
setCanExtractForAccessibility
public void setCanExtractForAccessibility(boolean allowExtraction)
Set if the user can extract content from the document for accessibility purposes.
allowExtraction
- A boolean determining if the user can extract content
from the document.
setCanFillInForm
public void setCanFillInForm(boolean allowFillingInForm)
Set if the user can fill in interactive forms.
allowFillingInForm
- A boolean determining if the user can fill in interactive forms.
setCanModify
public void setCanModify(boolean allowModifications)
Set if the user can modify the document.
allowModifications
- A boolean determining if the user can modify the document.
setCanModifyAnnotations
public void setCanModifyAnnotations(boolean allowAnnotationModification)
Set if the user can modify annotations.
allowAnnotationModification
- A boolean determining if the user can modify annotations.
setCanPrint
public void setCanPrint(boolean allowPrinting)
Set if the user can print.
allowPrinting
- A boolean determining if the user can print.
setCanPrintDegraded
public void setCanPrintDegraded(boolean allowAssembly)
Set if the user can print the document in a degraded format.
allowAssembly
- A boolean determining if the user can print the
document in a degraded format.
setOwnerKey
public void setOwnerKey(byte[] o)
throws IOException
This will set the O entry in the standard encryption dictionary.
- setOwnerKey in interface PDEncryptionDictionary
o
- A 32 byte array or null if there is no owner key.
setRevision
public void setRevision(int revision)
This will set the R entry of the encryption dictionary.
See PDF Reference 1.4 Table 3.14.
Note: This value is used to decrypt the pdf document. If you change this when
the document is encrypted then decryption will fail!.
- setRevision in interface PDEncryptionDictionary
revision
- The new encryption version.
setUserKey
public void setUserKey(byte[] u)
throws IOException
This will set the U entry in the standard encryption dictionary.
- setUserKey in interface PDEncryptionDictionary