EncryptFileEx
Security and signatures
Description
Writes an encrypted copy of a PDF file using the supplied owner and user passwords, encryption strength and typed permission set. It returns 1 when the output file is written and 0 when encryption fails.
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 values
| 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