public class Security extends Object
The Security class encapsulates various settings and options that can be used to apply security measures to a PDF document in the GroupDocs.Viewer component. These options include password protection, permissions, and more. For details, see the documentation.
Example usage:
Security security = new Security();
security.setDocumentOpenPassword("myPassword");
security.setPermissions(Permissions.DENY_MODIFICATION);
final PdfViewOptions pdfViewOptions = new PdfViewOptions();
pdfViewOptions.setSecurity(security);
try (Viewer viewer = new Viewer("document.pdf")) {
viewer.view(pdfViewOptions);
// Use the viewer object for further operations
}
Viewer,
PdfViewOptions,
Permissions| Constructor and Description |
|---|
Security()
Initializes a new instance of the
Security class. |
| Modifier and Type | Method and Description |
|---|---|
String |
getDocumentOpenPassword()
Gets the password required to open the PDF document.
|
int |
getPermissions()
Gets the PDF document permissions such as printing, modification, and data extraction.
|
String |
getPermissionsPassword()
Gets the password required to change permission settings.
|
void |
setDocumentOpenPassword(String value)
Sets the password required to open the PDF document.
|
void |
setPermissions(int value)
Sets the PDF document permissions such as printing, modification, and data extraction.
|
void |
setPermissionsPassword(String value)
Sets the password required to change permission settings.
|
public final String getDocumentOpenPassword()
Gets the password required to open the PDF document.
For code sample, see the documentation.
public final int getPermissions()
Gets the PDF document permissions such as printing, modification, and data extraction.
For code sample, see the documentation.
public final String getPermissionsPassword()
Gets the password required to change permission settings.
Using a permissions password, you can restrict printing, modification, and data extraction. Use a permissions password to restrict printing, modification and data extraction. For code sample, see the documentation.
public final void setDocumentOpenPassword(String value)
Sets the password required to open the PDF document.
For code sample, see the documentation.
value - The document open password.public final void setPermissions(int value)
Sets the PDF document permissions such as printing, modification, and data extraction.
For code sample, see the documentation.
value - The PDF document permissions.public final void setPermissionsPassword(String value)
Sets the password required to change permission settings.
Using a permissions password, you can restrict printing, modification, and data extraction. Use a permissions password to restrict printing, modification and data extraction. For code sample, see the documentation.
value - The permissions password.Copyright © 2024. All rights reserved.