EncryptFileEx

Security and signatures

Description

This page describes EncryptFileEx in PDF Library for Delphi, which belongs to the "Security and signatures" topic. API names, parameters, class names, file names, and literals are kept exactly as they are to correspond fully with the Delphi library and DLL entry points.

Please review the syntax, parameters, and return value before calling the function.

Syntax

Delphi

Function TPDFlib.EncryptFileEx(Const InputFileName, OutputFileName, Owner, User: WideString; Strength: Integer; Permissions: TPDFlibUserPermissions): Integer;

Parameters

InputFileNameSource PDF path
OutputFileNameDestination PDF path
OwnerOwner password
UserUser password
Strength0 = RC4-40, 1 = RC4-128, 2 = AES-128, 3 = AES-256, 4 = AES-256 Acrobat X, 5 = AES-256-GCM for PDF 2.0 with ISO TS 32003
PermissionsTyped permission set

Return Value

0Encryption failed
1Encryption succeeded

Remarks

Call SetPDFMACEnabled first to add a standalone PDF MAC integrity token when strength 4 or 5 is selected