com.qoppa.pdf.permissions
Class AllPDFPermissions

java.lang.Object
  extended by com.qoppa.pdf.permissions.AllPDFPermissions

public class AllPDFPermissions
extends Object

This class encompasses all of the document's permissions including Password permissions, DocMDP permissions, and Usage Rights permissions. It has methods to check if an operation is allowed to be performed by all the document's permissions. It can also return a Restrictions object that contains information about which type of permission is restricting an operation.


Constructor Summary
AllPDFPermissions(PasswordPermissions passwordPermissions, DocMDPPermissions docMDPPermissions, UsageRightsPermissions usageRightsPermissions)
          Construct a new AllPDFPermissions object that encompasses PasswordPermissions, DocMDPPermissions, and UsageRightsPermissions.
 
Method Summary
 Restrictions getAssembleDocumentRestrictions(boolean checkOwnerPassword)
          Returns a new Restrictions object that contains information about which type of Permission restricts assembling the document:
 Restrictions getChangeDocumentRestrictions(boolean checkOwnerPassword)
          Returns a new Restrictions object that contains information about which type of Permission restricts changing the document:
 DocMDPPermissions getDocMDPPermissions()
          Returns the Document Modification Detection and Prevention permissions.
 Restrictions getExtractTextGraphicsForAccessibilityRestrictions(boolean checkOwnerPassword)
          Returns a new Restrictions object that contains information about which type of Permission restricts extracting text graphics for accessibility:
 Restrictions getExtractTextGraphicsRestrictions(boolean checkOwnerPassword)
          Returns a new Restrictions object that contains information about which type of Permission restricts extracting text graphics:
 Restrictions getFillFormFieldsRestrictions(boolean checkOwnerPassword)
          Returns a new Restrictions object that contains information about which type of Permission restricts filling form fields:
 Restrictions getModifyAnnotsRestrictions(boolean checkOwnerPassword)
          Returns a new Restrictions object that contains information about which type of Permission restricts modifying annotations:
 PasswordPermissions getPasswordPermissions()
          Returns the permission object for this document.
 Restrictions getPrintHighResRestrictions(boolean checkOwnerPassword)
          Returns a new Restrictions object that contains information about which type of Permission restricts printing the document at high resolution:
 Restrictions getPrintRestrictions(boolean checkOwnerPassword)
          Returns a new Restrictions object that contains information about which type of Permission restricts printing the document:
 UsageRightsPermissions getUsageRightsPermissions()
          Returns the Usage Rights permissions.
 boolean isAssembleDocumentAllowed(boolean checkOwnerPassword)
          Returns true if all the document's permissions allow assembling the document:
 boolean isChangeDocumentAllowed(boolean checkOwnerPassword)
          Returns true if all the document's permissions allow changing the document.
 boolean isCreateModifyFieldsAllowed(boolean checkOwnerPassword)
          Returns true if all the document's permissions allow modifying annotations and changing the document.
 boolean isExtractTextGraphicsAllowed(boolean checkOwnerPassword)
          Returns true if all the document's permissions allow extracting text graphics from the document.
 boolean isExtractTextGraphicsForAccessibilityAllowed(boolean checkOwnerPassword)
          Returns true if all the document's permissions allow extracting text graphics for accessibility from the document.
 boolean isFillFormFieldsAllowed(boolean checkOwnerPassword)
          Returns true if all the document's permissions allow filling form field.
 boolean isModifyAnnotsAllowed(boolean checkOwnerPassword)
          Returns true if all the document's permissions allow modifying annotations.
 boolean isPrintAllowed(boolean checkOwnerPassword)
          Returns true if all the document's permissions allow printing the document.
 boolean isPrintHighResAllowed(boolean checkOwnerPassword)
          Returns true if all the document's permissions allow printing the document at high resolution.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AllPDFPermissions

public AllPDFPermissions(PasswordPermissions passwordPermissions,
                         DocMDPPermissions docMDPPermissions,
                         UsageRightsPermissions usageRightsPermissions)
Construct a new AllPDFPermissions object that encompasses PasswordPermissions, DocMDPPermissions, and UsageRightsPermissions.

Parameters:
passwordPermissions -
docMDPPermissions -
usageRightsPermissions -
Method Detail

isAssembleDocumentAllowed

public boolean isAssembleDocumentAllowed(boolean checkOwnerPassword)
Returns true if all the document's permissions allow assembling the document:

Parameters:
checkOwnerPassword - Set to true to check the owner password. If this is true and the owner's password has been entered, then this permission will be allowed by PasswordPermissions. However, this permission could still be restricted by other permission types.
Returns:
Permission to assemble the document.

isChangeDocumentAllowed

public boolean isChangeDocumentAllowed(boolean checkOwnerPassword)
Returns true if all the document's permissions allow changing the document.

Parameters:
checkOwnerPassword - Set to true to check the owner password. If this is true and the owner's password has been entered, then this permission will be allowed by PasswordPermissions. However, this permission could still be restricted by other permission types.
Returns:
Permission to change the document.

isCreateModifyFieldsAllowed

public boolean isCreateModifyFieldsAllowed(boolean checkOwnerPassword)
Returns true if all the document's permissions allow modifying annotations and changing the document.

Parameters:
checkOwnerPassword - Set to true to check the owner password. If this is true and the owner's password has been entered, then this permission will be allowed by PasswordPermissions. However, this permission could still be restricted by other permission types.
Returns:
Permission to change the document.

isExtractTextGraphicsAllowed

public boolean isExtractTextGraphicsAllowed(boolean checkOwnerPassword)
Returns true if all the document's permissions allow extracting text graphics from the document.

Parameters:
checkOwnerPassword - Set to true to check the owner password. If this is true and the owner's password has been entered, then this permission will be allowed by PasswordPermissions. However, this permission could still be restricted by other permission types.
Returns:
Permission to extract text graphics from the document.

isExtractTextGraphicsForAccessibilityAllowed

public boolean isExtractTextGraphicsForAccessibilityAllowed(boolean checkOwnerPassword)
Returns true if all the document's permissions allow extracting text graphics for accessibility from the document.

Parameters:
checkOwnerPassword - Set to true to check the owner password. If this is true and the owner's password has been entered, then this permission will be allowed by PasswordPermissions. However, this permission could still be restricted by other permission types.
Returns:
Permission to extract text graphics for accessibility.

isFillFormFieldsAllowed

public boolean isFillFormFieldsAllowed(boolean checkOwnerPassword)
Returns true if all the document's permissions allow filling form field.

Parameters:
checkOwnerPassword - Set to true to check the owner password. If this is true and the owner's password has been entered, then this permission will be allowed by PasswordPermissions. However, this permission could still be restricted by other permission types.
Returns:
Permission to fill form fields.

isModifyAnnotsAllowed

public boolean isModifyAnnotsAllowed(boolean checkOwnerPassword)
Returns true if all the document's permissions allow modifying annotations.

Parameters:
checkOwnerPassword - Set to true to check the owner password. If this is true and the owner's password has been entered, then this permission will be allowed by PasswordPermissions. However, this permission could still be restricted by other permission types.
Returns:
Permission to modify annotations.

isPrintAllowed

public boolean isPrintAllowed(boolean checkOwnerPassword)
Returns true if all the document's permissions allow printing the document.

Parameters:
checkOwnerPassword - Set to true to check the owner password. If this is true and the owner's password has been entered, then this permission will be allowed by PasswordPermissions. However, this permission could still be restricted by other permission types.
Returns:
Permission to print the document.

isPrintHighResAllowed

public boolean isPrintHighResAllowed(boolean checkOwnerPassword)
Returns true if all the document's permissions allow printing the document at high resolution.

Parameters:
checkOwnerPassword - Set to true to check the owner password. If this is true and the owner's password has been entered, then this permission will be allowed by PasswordPermissions. However, this permission could still be restricted by other permission types.
Returns:
Permission to print the document at high resolution.

getAssembleDocumentRestrictions

public Restrictions getAssembleDocumentRestrictions(boolean checkOwnerPassword)
Returns a new Restrictions object that contains information about which type of Permission restricts assembling the document:

Parameters:
checkOwnerPassword - Set to true to check the owner password. If this is true and the owner's password has been entered, then this permission will be allowed by PasswordPermissions. However, this permission could still be restricted by other permission types.
Returns:
Restrictions for assembling the document.

getChangeDocumentRestrictions

public Restrictions getChangeDocumentRestrictions(boolean checkOwnerPassword)
Returns a new Restrictions object that contains information about which type of Permission restricts changing the document:

Parameters:
checkOwnerPassword - Set to true to check the owner password. If this is true and the owner's password has been entered, then this permission will be allowed by PasswordPermissions. However, this permission could still be restricted by other permission types.
Returns:
Restrictions for changing the document.

getExtractTextGraphicsRestrictions

public Restrictions getExtractTextGraphicsRestrictions(boolean checkOwnerPassword)
Returns a new Restrictions object that contains information about which type of Permission restricts extracting text graphics:

Parameters:
checkOwnerPassword - Set to true to check the owner password. If this is true and the owner's password has been entered, then this permission will be allowed by PasswordPermissions. However, this permission could still be restricted by other permission types.
Returns:
Restrictions for extracting text graphics.

getExtractTextGraphicsForAccessibilityRestrictions

public Restrictions getExtractTextGraphicsForAccessibilityRestrictions(boolean checkOwnerPassword)
Returns a new Restrictions object that contains information about which type of Permission restricts extracting text graphics for accessibility:

Parameters:
checkOwnerPassword - Set to true to check the owner password. If this is true and the owner's password has been entered, then this permission will be allowed by PasswordPermissions. However, this permission could still be restricted by other permission types.
Returns:
Restrictions for extracting text graphics for accessibility.

getFillFormFieldsRestrictions

public Restrictions getFillFormFieldsRestrictions(boolean checkOwnerPassword)
Returns a new Restrictions object that contains information about which type of Permission restricts filling form fields:

Parameters:
checkOwnerPassword - Set to true to check the owner password. If this is true and the owner's password has been entered, then this permission will be allowed by PasswordPermissions. However, this permission could still be restricted by other permission types.
Returns:
Restrictions for filling form fields.

getModifyAnnotsRestrictions

public Restrictions getModifyAnnotsRestrictions(boolean checkOwnerPassword)
Returns a new Restrictions object that contains information about which type of Permission restricts modifying annotations:

Parameters:
checkOwnerPassword - Set to true to check the owner password. If this is true and the owner's password has been entered, then this permission will be allowed by PasswordPermissions. However, this permission could still be restricted by other permission types.
Returns:
Restrictions for modifying annotations.

getPrintRestrictions

public Restrictions getPrintRestrictions(boolean checkOwnerPassword)
Returns a new Restrictions object that contains information about which type of Permission restricts printing the document:

Parameters:
checkOwnerPassword - Set to true to check the owner password. If this is true and the owner's password has been entered, then this permission will be allowed by PasswordPermissions. However, this permission could still be restricted by other permission types.
Returns:
Restrictions for printing the document.

getPrintHighResRestrictions

public Restrictions getPrintHighResRestrictions(boolean checkOwnerPassword)
Returns a new Restrictions object that contains information about which type of Permission restricts printing the document at high resolution:

Parameters:
checkOwnerPassword - Set to true to check the owner password. If this is true and the owner's password has been entered, then this permission will be allowed by PasswordPermissions. However, this permission could still be restricted by other permission types.
Returns:
Restrictions for printing the document at high resolution.

getPasswordPermissions

public PasswordPermissions getPasswordPermissions()
Returns the permission object for this document. A new permissions object with all permissions is returned if the document is not encrypted.

Returns:
The permission object.

getDocMDPPermissions

public DocMDPPermissions getDocMDPPermissions()
Returns the Document Modification Detection and Prevention permissions. May be null.


getUsageRightsPermissions

public UsageRightsPermissions getUsageRightsPermissions()
Returns the Usage Rights permissions. May be null.