aspose.pdf
Class Security

java.lang.Object
  extended by aspose.pdf.Security

public class Security
extends java.lang.Object

Encapsulates information used in pdf Security.

Typical usages are the following:

[Java] Pdf pdf1 = new Pdf(); pdf1.setSecurity(new Security()); pdf1.getSecurity().setIsCopyingAllowed(false); pdf1.getPageSetup().setPageHeight(PageSize.A2Height); Section sec1 = pdf1.getSections().add(); Text text1 = new Text("this is text content"); text1.getMargin().Top = 30; sec1.getParagraphs().add(text1); pdf1.save(....);


Constructor Summary
Security()
          Initializes a new instance of the Security class.
 
Method Summary
 boolean getIs128BitsEncrypted()
          Gets a boolean value that indicates whether the Pdf documents will be 128 bits or 40 bits encrypted.
 boolean getIsAnnotationsModifyingAllowed()
          Gets a bool value that indicates whether adding or modifying text annotations is allowed.
 boolean getIsContentsModifyingAllowed()
          Gets a bool value that indicates whether modifying contents is allowed.
 boolean getIsCopyingAllowed()
          Gets a bool value that indicates whether copying or otherwise extracting text and graphics from the document is allowed.
 boolean getIsDefaultAllAllowed()
          Gets or sets a bool value that indicates if all permissions are set to allowed as default.
 boolean getIsDegradedPrintingAllowed()
          Gets a bool value that indicates whether printing in low resolution is allowed.
 boolean getIsDocumentAssemblyingAllowed()
          Gets a bool value that indicates whether assembling the document is allowed.
 boolean getIsFormFillingAllowed()
          Gets a bool value that indicates whether filling in forms and signing the document is allowed.
 boolean getIsPrintingAllowed()
          Gets a bool value that indicates whether printing is allowed.
 boolean getIsScreenReadersAllowed()
          Gets a boolean value that indicates whether screen readers are allowed.
 java.lang.String getMasterPassword()
          Gets a string that indicates the master password used in pdf encryption.
 java.lang.String getUserPassword()
          Gets a string that indicates the user password used in pdf encryption.
 void setIs128BitsEncrypted(boolean value)
          Sets a boolean value that indicates whether the Pdf documents will be 128 bits or 40 bits encrypted.
 void setIsAnnotationsModifyingAllowed(boolean value)
          Sets a bool value that indicates whether adding or modifying text annotations is allowed.
 void setIsContentsModifyingAllowed(boolean value)
          Sets a bool value that indicates whether modifying contents is allowed.
 void setIsCopyingAllowed(boolean value)
          Sets a bool value that indicates whether copying or otherwise extracting text and graphics from the document is allowed.
 void setIsDefaultAllAllowed(boolean value)
          Sets or sets a bool value that indicates if all permissions are set to allowed as default.
 void setIsDegradedPrintingAllowed(boolean value)
          Sets a bool value that indicates whether printing in low resolution is allowed.
 void setIsDocumentAssemblyingAllowed(boolean value)
          Sets a bool value that indicates whether assembling the document is allowed.
 void setIsFormFillingAllowed(boolean value)
          Sets a bool value that indicates whether filling in forms and signing the document is allowed.
 void setIsPrintingAllowed(boolean value)
          Sets a bool value that indicates whether printing is allowed.
 void setIsScreenReadersAllowed(boolean value)
          Sets a boolean value that indicates whether screen readers are allowed.
 void setMasterPassword(java.lang.String value)
          Sets a string that indicates the master password used in pdf encryption.
 void setUserPassword(java.lang.String value)
          Sets a string that indicates the user password used in pdf encryption.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Security

public Security()
Initializes a new instance of the Security class.

Method Detail

getIs128BitsEncrypted

public boolean getIs128BitsEncrypted()
Gets a boolean value that indicates whether the Pdf documents will be 128 bits or 40 bits encrypted. Default is false, 40 bits encrypted.


setIs128BitsEncrypted

public void setIs128BitsEncrypted(boolean value)
Sets a boolean value that indicates whether the Pdf documents will be 128 bits or 40 bits encrypted.

Parameters:
value -

getUserPassword

public java.lang.String getUserPassword()
Gets a string that indicates the user password used in pdf encryption.


setUserPassword

public void setUserPassword(java.lang.String value)
Sets a string that indicates the user password used in pdf encryption.

Parameters:
value -

getMasterPassword

public java.lang.String getMasterPassword()
Gets a string that indicates the master password used in pdf encryption.


setMasterPassword

public void setMasterPassword(java.lang.String value)
Sets a string that indicates the master password used in pdf encryption.

Parameters:
value -

getIsPrintingAllowed

public boolean getIsPrintingAllowed()
Gets a bool value that indicates whether printing is allowed. Default is true.

Remarks: To fully disable Pdf documents to be printable both IsPrintingAllowed Security and IsDegradedPrintingAllowed Security should be false.


setIsPrintingAllowed

public void setIsPrintingAllowed(boolean value)
Sets a bool value that indicates whether printing is allowed. Default is true.

Remarks: To fully disable Pdf documents to be printable both IsPrintingAllowed Security and IsDegradedPrintingAllowed Security should be false.

Parameters:
value -

getIsContentsModifyingAllowed

public boolean getIsContentsModifyingAllowed()
Gets a bool value that indicates whether modifying contents is allowed. Default is true.


setIsContentsModifyingAllowed

public void setIsContentsModifyingAllowed(boolean value)
Sets a bool value that indicates whether modifying contents is allowed. Default is true.

Parameters:
value -

getIsCopyingAllowed

public boolean getIsCopyingAllowed()
Gets a bool value that indicates whether copying or otherwise extracting text and graphics from the document is allowed. Default is true.


setIsCopyingAllowed

public void setIsCopyingAllowed(boolean value)
Sets a bool value that indicates whether copying or otherwise extracting text and graphics from the document is allowed. Default is true.

Parameters:
value -

getIsAnnotationsModifyingAllowed

public boolean getIsAnnotationsModifyingAllowed()
Gets a bool value that indicates whether adding or modifying text annotations is allowed. Default is true.


setIsAnnotationsModifyingAllowed

public void setIsAnnotationsModifyingAllowed(boolean value)
Sets a bool value that indicates whether adding or modifying text annotations is allowed. Default is true.

Parameters:
value -

getIsFormFillingAllowed

public boolean getIsFormFillingAllowed()
Gets a bool value that indicates whether filling in forms and signing the document is allowed. Default is true.


setIsFormFillingAllowed

public void setIsFormFillingAllowed(boolean value)
Sets a bool value that indicates whether filling in forms and signing the document is allowed. Default is true.

Parameters:
value -

getIsScreenReadersAllowed

public boolean getIsScreenReadersAllowed()
Gets a boolean value that indicates whether screen readers are allowed. Default is true.


setIsScreenReadersAllowed

public void setIsScreenReadersAllowed(boolean value)
Sets a boolean value that indicates whether screen readers are allowed.

Parameters:
value -

getIsDocumentAssemblyingAllowed

public boolean getIsDocumentAssemblyingAllowed()
Gets a bool value that indicates whether assembling the document is allowed. This includes inserting, rotating, or deleting pages and creating navigation elements such as bookmarks or thumbnail images. Default is true.


setIsDocumentAssemblyingAllowed

public void setIsDocumentAssemblyingAllowed(boolean value)
Sets a bool value that indicates whether assembling the document is allowed. This includes inserting, rotating, or deleting pages and creating navigation elements such as bookmarks or thumbnail images. Default is true.

Parameters:
value -

getIsDegradedPrintingAllowed

public boolean getIsDegradedPrintingAllowed()
Gets a bool value that indicates whether printing in low resolution is allowed. Default is true.

Remarks:To fully disable Pdf documents to be printable both IsPrintingAllowed Security and IsDegradedPrintingAllowed Security should be false.


setIsDegradedPrintingAllowed

public void setIsDegradedPrintingAllowed(boolean value)
Sets a bool value that indicates whether printing in low resolution is allowed. Default is true.

Remarks:To fully disable Pdf documents to be printable both IsPrintingAllowed Security and IsDegradedPrintingAllowed Security should be false.

Parameters:
value -

getIsDefaultAllAllowed

public boolean getIsDefaultAllAllowed()
Gets or sets a bool value that indicates if all permissions are set to allowed as default. Default value is true. If this property is set to false, then all permissions are set to NOT allowed.


setIsDefaultAllAllowed

public void setIsDefaultAllAllowed(boolean value)
Sets or sets a bool value that indicates if all permissions are set to allowed as default. Default value is true. If this property is set to false, then all permissions are set to NOT allowed.

Parameters:
value -