๐Ÿ”’ Encryption

Password-protected PDFs with AES-256 encryption and granular permission control.

C# โ€” Encrypted PDF
doc.Encryption = new PdfEncryption
{
    // Empty = anyone can open
    UserPassword = "",
    // Full-access password
    OwnerPassword = "AdminPass123",
    // Strongest encryption
    Algorithm = PdfEncryptionAlgorithm.Aes256,
    // Granular permissions
    AllowPrinting = true,
    AllowCopying = false,
    AllowModifying = false,
    AllowAnnotating = true
};
Screenshot of the encrypted PDF in a viewer showing the security padlock icon and a permissions dialog displaying that printing is allowed but copying and modifying are restricted, with AES-256 encryption method indicated

You should see an "Encrypted Document" heading and a four-line paragraph describing the AES-256 settings (open without a password; copying and modifying restricted; owner password required for full access). Check Document Properties โ†’ Security in your viewer to confirm the permissions and encryption algorithm.
File: 11_encryption.pdf

Encryption Options

PropertyDescription
AlgorithmAes128 or Aes256
UserPasswordPassword to open the PDF (empty = no password needed)
OwnerPasswordPassword for full access (change permissions, etc.)
AllowPrintingAllow readers to print
AllowCopyingAllow copy/paste of text
AllowModifyingAllow document editing
AllowAnnotatingAllow adding comments