THotPDF.DADirectEncryptFileAES256 Method
Directly encrypts a given PDF file using the AES-256 algorithm and outputs it to a new file
Declaration
function DADirectEncryptFileAES256(const InputFileName: TFileName; const OutputFileName: TFileName; const OwnerPassword: AnsiString; const UserPassword: AnsiString; Permissions: THPDFProtectOptions; UseAESGCM: boolean): boolean;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
InputFileName | The unencrypted source PDF |
OutputFileName | The encrypted PDF to write |
OwnerPassword | The owner password |
UserPassword | The user password; leave it empty to let anyone open the file |
Permissions | Permissions granted to users opening the file with the user password |
UseAESGCM | True writes AES-GCM crypt filters, False AES-256-CBC |
Return values
Returns True if successfully encrypted and saved, otherwise returns False
Usage
- Call: THotPDF.DADirectEncryptFileAES256
- Used to rapidly add AES-256 encryption protection to a local PDF file without loading the entire file content into memory