PDF Generation Template Editor
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
ComPDFKit_Tools provides document security features, including setting open passwords, permission passwords, and document permission controls.
Access encryption settings via the "security" item in the More menu:
{
"toolbarConfig": {
"availableMenus": [
"security"
]
}
}Once set, a password is required to open the document:
Once set, user operations on the document can be restricted:
Both user password and owner password can be set simultaneously.
CDocumentEncryptionDialog is the main dialog for security settings, located in the com.compdfkit.tools.security.encryption package.
The encryption dialog is triggered by default via the "security" item in the More menu. It can also be opened programmatically:
CDocumentEncryptionDialog dialog = CDocumentEncryptionDialog.newInstance();
dialog.setDocument(cpdfDocument);
dialog.show(getSupportFragmentManager(), "encryption");val dialog = CDocumentEncryptionDialog.newInstance()
dialog.setDocument(cpdfDocument)
dialog.show(supportFragmentManager, "encryption")| Component | Description |
|---|---|
CDocumentEncryptionDialog | Encryption settings dialog |
CInputOwnerPasswordDialog | Owner password input dialog |
ComPDFKit supports the following encryption algorithms:
| Algorithm | Description |
|---|---|
| RC4 | RC4 encryption |
| AES-128 | 128-bit AES encryption |
| AES-256 | 256-bit AES encryption |
| No Encryption | Remove encryption |
If a document is encrypted, you can select "Remove Security Settings" in the security settings dialog to cancel password protection. The correct owner password must be entered before this operation can be performed.