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
| InputFileName | Source PDF path |
|---|---|
| OutputFileName | Destination PDF path |
| Owner | Owner password |
| User | User password |
| Strength | 0 = 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 |
| Permissions | Typed permission set |
Return Value
| 0 | Encryption failed |
|---|---|
| 1 | Encryption succeeded |
Remarks
Call SetPDFMACEnabled first to add a standalone PDF MAC integrity token when strength 4 or 5 is selected