PdfSecurityOptions

Inheritance: java.lang.Object

public class PdfSecurityOptions

Options for encrypting and access permissions for a PDF document. PDF/A does not allow security setting.

Constructors

ConstructorDescription
PdfSecurityOptions()The constructor of PdfSecurityOptions

Methods

MethodDescription
equals(Object arg0)
getAccessibilityExtractContent()Indicates whether to allow to extract text and graphics (in support of accessibility to users with disabilities or for other purposes).
getAnnotationsPermission()Indicates whether to allow to add or modify text annotations, fill in interactive form fields.
getAssembleDocumentPermission()Indicates whether to allow to assemble the document (insert, rotate, or delete pages and create bookmarks or thumbnail images), even if getModifyDocumentPermission() is clear.
getClass()
getExtractContentPermission()Indicates whether to allow to copy or otherwise extract text and graphics from the document by operations other than that controlled by getAccessibilityExtractContent().
getExtractContentPermissionObsolete()Permission to copy or extract content Obsoleted according to PDF reference.
getFillFormsPermission()Indicates whether to allow to fill in existing interactive form fields (including signature fields), even if getModifyDocumentPermission() is clear.
getFullQualityPrintPermission()Indicates whether to allow to print the document to a representation from which a faithful digital copy of the PDF content could be generated.
getModifyDocumentPermission()Indicates whether to allow to modify the contents of the document by operations other than those controlled by getAnnotationsPermission(), getFillFormsPermission() and getAssembleDocumentPermission().
getOwnerPassword()Gets the owner password for the encrypted PDF document.
getPrintPermission()Indicates whether to allow to print the document.
getUserPassword()Gets the user password required for opening the encrypted PDF document.
hashCode()
notify()
notifyAll()
setAccessibilityExtractContent(boolean value)Indicates whether to allow to extract text and graphics (in support of accessibility to users with disabilities or for other purposes).
setAnnotationsPermission(boolean value)Indicates whether to allow to add or modify text annotations, fill in interactive form fields.
setAssembleDocumentPermission(boolean value)Indicates whether to allow to assemble the document (insert, rotate, or delete pages and create bookmarks or thumbnail images), even if getModifyDocumentPermission() is clear.
setExtractContentPermission(boolean value)Indicates whether to allow to copy or otherwise extract text and graphics from the document by operations other than that controlled by getAccessibilityExtractContent().
setExtractContentPermissionObsolete(boolean value)Permission to copy or extract content Obsoleted according to PDF reference.
setFillFormsPermission(boolean value)Indicates whether to allow to fill in existing interactive form fields (including signature fields), even if getModifyDocumentPermission() is clear.
setFullQualityPrintPermission(boolean value)Indicates whether to allow to print the document to a representation from which a faithful digital copy of the PDF content could be generated.
setModifyDocumentPermission(boolean value)Indicates whether to allow to modify the contents of the document by operations other than those controlled by getAnnotationsPermission(), getFillFormsPermission() and getAssembleDocumentPermission().
setOwnerPassword(String value)Sets the owner password for the encrypted PDF document.
setPrintPermission(boolean value)Indicates whether to allow to print the document.
setUserPassword(String value)Sets the user password required for opening the encrypted PDF document.
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

PdfSecurityOptions()

public PdfSecurityOptions()

The constructor of PdfSecurityOptions

Example

The following code sets high resolution print permisson for the output pdf.

         Workbook wb = new Workbook();
         wb.getWorksheets().get(0).getCells().get("A1").setValue("Aspose");
 
         PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
 
 
         PdfSecurityOptions pdfSecurityOptions = new PdfSecurityOptions();
 
         //set owner password
         pdfSecurityOptions.setOwnerPassword("YourOwnerPassword");
 
         //set user password
         pdfSecurityOptions.setUserPassword("YourUserPassword");
 
         //set print permisson
         pdfSecurityOptions.setPrintPermission(true);
 
         //set high resolution for print
         pdfSecurityOptions.setFullQualityPrintPermission(true);
 
 
         pdfSaveOptions.setSecurityOptions(pdfSecurityOptions);
 
         wb.save("output.pdf", pdfSaveOptions);

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getAccessibilityExtractContent()

public boolean getAccessibilityExtractContent()

Indicates whether to allow to extract text and graphics (in support of accessibility to users with disabilities or for other purposes).

Returns: boolean

getAnnotationsPermission()

public boolean getAnnotationsPermission()

Indicates whether to allow to add or modify text annotations, fill in interactive form fields.

Remarks

if getModifyDocumentPermission() is also set, create or modify interactive form fields (including signature fields).

Returns: boolean

getAssembleDocumentPermission()

public boolean getAssembleDocumentPermission()

Indicates whether to allow to assemble the document (insert, rotate, or delete pages and create bookmarks or thumbnail images), even if getModifyDocumentPermission() is clear.

Returns: boolean

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getExtractContentPermission()

public boolean getExtractContentPermission()

Indicates whether to allow to copy or otherwise extract text and graphics from the document by operations other than that controlled by getAccessibilityExtractContent().

Returns: boolean

getExtractContentPermissionObsolete()

public boolean getExtractContentPermissionObsolete()

Permission to copy or extract content Obsoleted according to PDF reference.

Remarks

NOTE: This member is now obsolete. Instead, please use ExtractContentPermission property. This property will be removed 12 months later since September 2023. Aspose apologizes for any inconvenience you may have experienced.

Returns: boolean

getFillFormsPermission()

public boolean getFillFormsPermission()

Indicates whether to allow to fill in existing interactive form fields (including signature fields), even if getModifyDocumentPermission() is clear.

Returns: boolean

getFullQualityPrintPermission()

public boolean getFullQualityPrintPermission()

Indicates whether to allow to print the document to a representation from which a faithful digital copy of the PDF content could be generated.

Remarks

When it is clear (and getPrintPermission() is set), printing is limited to a low level representation of the appearance, possibly of degraded quality.

Returns: boolean

getModifyDocumentPermission()

public boolean getModifyDocumentPermission()

Indicates whether to allow to modify the contents of the document by operations other than those controlled by getAnnotationsPermission(), getFillFormsPermission() and getAssembleDocumentPermission().

Returns: boolean

getOwnerPassword()

public String getOwnerPassword()

Gets the owner password for the encrypted PDF document.

Remarks

The owner password allows the user to open an encrypted PDF document without any access restrictions specified.

Returns: java.lang.String

getPrintPermission()

public boolean getPrintPermission()

Indicates whether to allow to print the document.

Remarks

Possibly not at the highest quality level, depending on whether getFullQualityPrintPermission() is also set.

Returns: boolean

getUserPassword()

public String getUserPassword()

Gets the user password required for opening the encrypted PDF document.

Remarks

The owner password or user password will be required to open an encrypted PDF document for viewing.

The user password can be null or empty string, in this case no password will be required from the user when opening the PDF document.

Opening the document with the correct owner password allows full access to the document.

Opening the document with the correct user password (or opening a document that does not have a user password) allows limited access as the permissions specified.

Returns: java.lang.String

hashCode()

public native int hashCode()

Returns: int

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

setAccessibilityExtractContent(boolean value)

public void setAccessibilityExtractContent(boolean value)

Indicates whether to allow to extract text and graphics (in support of accessibility to users with disabilities or for other purposes).

Parameters:

ParameterTypeDescription
valueboolean

setAnnotationsPermission(boolean value)

public void setAnnotationsPermission(boolean value)

Indicates whether to allow to add or modify text annotations, fill in interactive form fields.

Remarks

if getModifyDocumentPermission() is also set, create or modify interactive form fields (including signature fields).

Parameters:

ParameterTypeDescription
valueboolean

setAssembleDocumentPermission(boolean value)

public void setAssembleDocumentPermission(boolean value)

Indicates whether to allow to assemble the document (insert, rotate, or delete pages and create bookmarks or thumbnail images), even if getModifyDocumentPermission() is clear.

Parameters:

ParameterTypeDescription
valueboolean

setExtractContentPermission(boolean value)

public void setExtractContentPermission(boolean value)

Indicates whether to allow to copy or otherwise extract text and graphics from the document by operations other than that controlled by getAccessibilityExtractContent().

Parameters:

ParameterTypeDescription
valueboolean

setExtractContentPermissionObsolete(boolean value)

public void setExtractContentPermissionObsolete(boolean value)

Permission to copy or extract content Obsoleted according to PDF reference.

Remarks

NOTE: This member is now obsolete. Instead, please use ExtractContentPermission property. This property will be removed 12 months later since September 2023. Aspose apologizes for any inconvenience you may have experienced.

Parameters:

ParameterTypeDescription
valueboolean

setFillFormsPermission(boolean value)

public void setFillFormsPermission(boolean value)

Indicates whether to allow to fill in existing interactive form fields (including signature fields), even if getModifyDocumentPermission() is clear.

Parameters:

ParameterTypeDescription
valueboolean

setFullQualityPrintPermission(boolean value)

public void setFullQualityPrintPermission(boolean value)

Indicates whether to allow to print the document to a representation from which a faithful digital copy of the PDF content could be generated.

Remarks

When it is clear (and getPrintPermission() is set), printing is limited to a low level representation of the appearance, possibly of degraded quality.

Parameters:

ParameterTypeDescription
valueboolean

setModifyDocumentPermission(boolean value)

public void setModifyDocumentPermission(boolean value)

Indicates whether to allow to modify the contents of the document by operations other than those controlled by getAnnotationsPermission(), getFillFormsPermission() and getAssembleDocumentPermission().

Parameters:

ParameterTypeDescription
valueboolean

setOwnerPassword(String value)

public void setOwnerPassword(String value)

Sets the owner password for the encrypted PDF document.

Remarks

The owner password allows the user to open an encrypted PDF document without any access restrictions specified.

Parameters:

ParameterTypeDescription
valuejava.lang.String

setPrintPermission(boolean value)

public void setPrintPermission(boolean value)

Indicates whether to allow to print the document.

Remarks

Possibly not at the highest quality level, depending on whether getFullQualityPrintPermission() is also set.

Parameters:

ParameterTypeDescription
valueboolean

setUserPassword(String value)

public void setUserPassword(String value)

Sets the user password required for opening the encrypted PDF document.

Remarks

The owner password or user password will be required to open an encrypted PDF document for viewing.

The user password can be null or empty string, in this case no password will be required from the user when opening the PDF document.

Opening the document with the correct owner password allows full access to the document.

Opening the document with the correct user password (or opening a document that does not have a user password) allows limited access as the permissions specified.

Parameters:

ParameterTypeDescription
valuejava.lang.String

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int