Pdf - PdfEncryptionType
30 Sep 20261 minute to read
Public Enum to define PDF encryption algorithm types.
// Load an existing PDF document
let document: PdfDocument = new PdfDocument(data, password);
// Create security options with AES-128 encryption
let securityOptions: PdfSecurityOptions = {
encryptionType: PdfEncryptionType.aesBit128,
userPassword: 'user123'
};
// Apply security settings
document.setSecurity(securityOptions);
// Save the document
document.save('output.pdf');
// Destroy the document
document.destroy();-
aesBit128- Specifies AES encryption with 128-bit key length -
aesBit256Rev5- Specifies AES-256 encryption with Revision 5 (PDF 1.7 Extension Level 3) -
aesBit256Rev6- Specifies AES-256 encryption with Revision 6 (PDF 2.0) -
rc4Bit128- Specifies RC4 encryption with 128-bit key length -
rc4Bit40- Specifies RC4 encryption with 40-bit key length