java.lang.Object
com.aspose.words.PdfEncryptionAlgorithm
public class PdfEncryptionAlgorithm
- extends java.lang.Object
Utility class containing constants.
Specifies the encryption algorithm to use for encrypting a PDF document.
Example:
Demonstrates how to set permissions on a PDF document generated by Aspose.Words.
Document doc = new Document(getMyDir() + "Rendering.doc");
PdfSaveOptions saveOptions = new PdfSaveOptions();
// Create encryption details and set owner password.
PdfEncryptionDetails encryptionDetails = new PdfEncryptionDetails("", "password", PdfEncryptionAlgorithm.RC_4_128);
// Start by disallowing all permissions.
encryptionDetails.setPermissions(PdfPermissions.DISALLOW_ALL);
// Extend permissions to allow editing or modifying annotations.
encryptionDetails.setPermissions(PdfPermissions.MODIFY_ANNOTATIONS | PdfPermissions.DOCUMENT_ASSEMBLY);
saveOptions.setEncryptionDetails(encryptionDetails);
// Render the document to PDF format with the specified permissions.
doc.save(getMyDir() + "Rendering.SpecifyPermissions Out.pdf", saveOptions);
Field Summary |
static final int | RC_4_40 = 0 | |
RC4 encryption, key length of 40 bits.
|
static final int | RC_4_128 = 1 | |
RC4 encryption, key length of 128 bits.
|
RC_4_40 = 0 | |
public static final int RC_4_40 |
-
RC4 encryption, key length of 40 bits.
RC_4_128 = 1 | |
public static final int RC_4_128 |
-
RC4 encryption, key length of 128 bits.
See Also:
Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
Aspose.Words Support Forum - our preferred method of support.