com.crionics.jpdf.encryption
Class Permissions

java.lang.Object
  extended by com.crionics.jpdf.encryption.Permissions
All Implemented Interfaces:
java.lang.Cloneable

public class Permissions
extends java.lang.Object
implements java.lang.Cloneable

This class allow you to specify the permissions to apply to a document when encrypted and/or recover the permissions of an encrypted document. Note 1: Due to the evolution of the Permissions implementations in the PDF Specification, some of the attributes set in this object may be changed during the encrytion process. Please read carefully the description of each methodes in this class, where this effect is described when relevant.


Field Summary
static int QUALITY_HIGH
           
static int QUALITY_LOW
           
 
Constructor Summary
Permissions()
           
 
Method Summary
 java.lang.Object clone()
           
 boolean equals(java.lang.Object o)
           
 boolean getCanAssemble()
          Returns the Assembly permissions.
 boolean getCanExtract()
          Returns the copy/extraction of text and Graphics permissions.
 boolean getCanExtractForScreenReaders()
          Returns the copy/extraction of text and Graphics permissions in support of accessibility to disabled users.
 boolean getCanFillFormFields()
          Returns the Form Fields filling (and signing for Signature) permissions.
 boolean getCanModify()
          Returns the modifications permissions for operations other than those controlled by getCanModifyAnnotation(), getCanFillFormFields()and getCanAssemble()
 boolean getCanModifyAnnotation()
          Returns the addition/modification of Text Annotations permissions.
 boolean getCanModifyFormFields()
          Returns the addition/modification of From Fields (and Signature) permissions.
 boolean getCanPrint()
          Returns the printout permissions.
 int getPrintQuality()
          Returns the printout Quality of this document.
 int hashCode()
           
 boolean isAllowingAll()
          Returns true if all the permissions are allowed, false otherwise.
 void setAllowAll()
          Sets all the permissions in the most open way.
 void setCanAssemble(boolean flag)
          Sets the Assembly Permission.
 void setCanExtract(boolean flag)
          Sets the copy/extraction of text and Graphics permissions.
 void setCanExtractForScreenReaders(boolean flag)
          Sets the copy/extraction of text and Graphics permissions in support of accessibility to disabled users.
 void setCanFillFormFields(boolean flag)
          Sets the Form Fields filling (and signing for Signature) permissions.
 void setCanModify(boolean flag)
          Sets the modifications permissions for operations other than those controlled by setCanModifyAnnotation(boolean), setCanFillFormFields(boolean)and setCanAssemble(boolean).
 void setCanModifyAnnotation(boolean flag)
          Sets the addition/modification of Text Annotations permissions.
 void setCanPrint(boolean flag)
          Sets the printout permissions.
 void setDenyAll()
          Sets all the permissions in the most restrictive way.
 void setPrintQuality(int value)
          Sets the printout Quality of this document.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUALITY_HIGH

public static final int QUALITY_HIGH
See Also:
Constant Field Values

QUALITY_LOW

public static final int QUALITY_LOW
See Also:
Constant Field Values
Constructor Detail

Permissions

public Permissions()
Method Detail

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

getCanAssemble

public boolean getCanAssemble()
Returns the Assembly permissions. NOTE 1: Document assembly includes:

Returns:
true if allowed, false otherwise.

getCanExtract

public boolean getCanExtract()
Returns the copy/extraction of text and Graphics permissions.

Returns:
true if allowed, false otherwise.

getCanExtractForScreenReaders

public boolean getCanExtractForScreenReaders()
Returns the copy/extraction of text and Graphics permissions in support of accessibility to disabled users.

Returns:
true if allowed, false otherwise.

getCanFillFormFields

public boolean getCanFillFormFields()
Returns the Form Fields filling (and signing for Signature) permissions.

Returns:
true if allowed, false otherwise.

getCanModify

public boolean getCanModify()
Returns the modifications permissions for operations other than those controlled by getCanModifyAnnotation(), getCanFillFormFields()and getCanAssemble()

Returns:
true if allowed, false otherwise.

getCanModifyAnnotation

public boolean getCanModifyAnnotation()
Returns the addition/modification of Text Annotations permissions.

Returns:
true if allowed, false otherwise.

getCanModifyFormFields

public boolean getCanModifyFormFields()
Returns the addition/modification of From Fields (and Signature) permissions. Note 1: This method returns the results of: getCanModify()& getCanModifyAnnotation().

Returns:
true if allowed, false otherwise.

getCanPrint

public boolean getCanPrint()
Returns the printout permissions.

Returns:
true if allowed, false otherwise.

getPrintQuality

public int getPrintQuality()
Returns the printout Quality of this document. Note: The returned value get only relevant if getCanPrint() returns true.

Returns:
Returns QUALITY_LOWor QUALITY_HIGH.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

isAllowingAll

public boolean isAllowingAll()
Returns true if all the permissions are allowed, false otherwise.

Returns:
true /false.

setAllowAll

public void setAllowAll()
Sets all the permissions in the most open way.


setCanAssemble

public void setCanAssemble(boolean flag)
Sets the Assembly Permission. NOTE 1: Document assembly includes: NOTE 2: If the document is encrypted with a 40 bit key length or in a 1.3 PDF version compliant (acrobat 3.0 or later), this attribute will be overwriten by the value of setCanModify(boolean). Default Value: true

Parameters:
flag - true to allow it, false otherwise.

setCanExtract

public void setCanExtract(boolean flag)
Sets the copy/extraction of text and Graphics permissions. NOTE 1: If the document is encrypted with a 40 bit key length or in a 1.3 PDF version compliant (acrobat 3.0 or later), this attribute will overwrite the value of setCanExtractForScreenReaders(boolean). Default Value: true

Parameters:
flag - true to allow it, false otherwise.

setCanExtractForScreenReaders

public void setCanExtractForScreenReaders(boolean flag)
Sets the copy/extraction of text and Graphics permissions in support of accessibility to disabled users. NOTE 1: If the document is encrypted with a 40 bit key length or in a 1.3 PDF version compliant (acrobat 3.0 or later), this attribute will be overwriten by the value of setCanExtract(boolean). Default Value: true

Parameters:
flag - true to allow it, false otherwise.

setCanFillFormFields

public void setCanFillFormFields(boolean flag)
Sets the Form Fields filling (and signing for Signature) permissions. NOTE 1: If the document is encrypted with a 40 bit key length or in a 1.3 PDF version compliant (acrobat 3.0 or later), this attribute will be overwriten by the value of setCanModifyAnnotation(boolean). Default Value: true

Parameters:
flag - true to allow it, false otherwise.

setCanModify

public void setCanModify(boolean flag)
Sets the modifications permissions for operations other than those controlled by setCanModifyAnnotation(boolean), setCanFillFormFields(boolean)and setCanAssemble(boolean). NOTE 1: setting this attribute to true along the attribute defined by setCanModifyAnnotation(boolean)will allow the addition/modification of From Fields (and Signature). NOTE 2: If the document is encrypted with a 40 bit key length or in a 1.3 PDF version compliant (acrobat 3.0 or later), this attribute will overwrite the value of setCanAssemble(boolean). Default Value: true

Parameters:
flag - true to allow it, false otherwise.

setCanModifyAnnotation

public void setCanModifyAnnotation(boolean flag)
Sets the addition/modification of Text Annotations permissions. NOTE 1: setting this attribute to true along the attribute defined by setCanModify(boolean)will allow the addition/modification of From Fields (and Signature). Default Value: true

Parameters:
flag - true to allow it, false otherwise.

setCanPrint

public void setCanPrint(boolean flag)
Sets the printout permissions. Default Value: true

Parameters:
flag - true to allow it, false otherwise.

setDenyAll

public void setDenyAll()
Sets all the permissions in the most restrictive way.


setPrintQuality

public void setPrintQuality(int value)
Sets the printout Quality of this document. Note 1: The attribute is only relevant if setCanPrint(boolean) set to true. NOTE 2: If the document is encrypted with a 40 bit key length or in a 1.3 PDF version compliant (acrobat 3.0 or later), this attribute will overwrite the value of QUALITY_HIGH. Default Value: QUALITY_HIGH

Parameters:
value - QUALITY_LOWfor a 150 dpi impression or QUALITY_HIGHfor a maximum quality


Copyright © 1999-2007 Crionics. All Rights Reserved.