THotPDF.DADirectEncryptFileAES256 Method
Provides the DADirectEncryptFileAES256 behavior for the security workflow. Use it when the surrounding API family needs explicit control over PDF objects, page content, resources, conformance, or diagnostics
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 | Unencrypted source PDF |
OutputFileName | Encrypted PDF to write |
OwnerPassword | Owner password |
UserPassword | User password; an empty one lets anyone open the file |
Permissions | Permissions granted to users who open the file with the user password |
UseAESGCM | True writes AES-GCM crypt filters, False AES-256-CBC |
Return value
Returns a boolean value
Usage notes
- Use this API in the security workflow before the affected page, resource, field, or catalog object is finalized
- Keep object names, field names, resource names, and returned handles stable until the document is finalized