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

NamePurpose
InputFileNameThe unencrypted source PDF
OutputFileNameThe encrypted PDF to write
OwnerPasswordThe owner password
UserPasswordThe user password; leave it empty to let anyone open the file
PermissionsPermissions granted to users opening the file with the user password
UseAESGCMTrue writes AES-GCM crypt filters, False AES-256-CBC

Return values

Returns True if successfully encrypted and saved, otherwise returns False

Usage

See also