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
}
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.
Returns:
java.lang.String - the permissions password.
setPermissionsPassword(String value)
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.
Parameters:
Parameter
Type
Description
value
java.lang.String
The permissions password.
getPermissions()
public final int getPermissions()
Gets the PDF document permissions such as printing, modification, and data extraction.