EncryptA
Security and Signatures
Description
The trailing A denotes the ANSI (char) DLL entry point; the ActiveX/COM surface exposes only the Unicode form. Behaviour is identical to Encrypt and string arguments are interpreted using the current SetAnsiMode code page
This function adds the specified security settings to the selected document.
The actual encryption of the document is delayed until the document is saved so this function can be called at any time, even before further content is added to the document.
Syntax
Delphi
Function DLEncryptA(InstanceID: Integer; Owner, User: PAnsiChar; Strength, Permissions: Integer): Integer;
DLL
int DLEncryptA(int InstanceID, const char * Owner, const char * User, int Strength, int Permissions);
Parameters
| Owner | The owner or master password for the document |
|---|---|
| User | The user password for the document |
| Strength | The strength of encryption to use: 0 = 40-bit encryption 1 = 128-bit RC4 encryption 2 = 128-bit AES encryption (requires Acrobat 7 or later) 3 = 256-bit AES encryption (requires Acrobat 9 or later) 4 = 256-bit AES encryption (requires Acrobat X or later) |
| Permissions | A value created with the EncodePermissions function |
Return values
| 0 | The document could not be encrypted. Use the LastErrorCode function to determine the reason for failure. The document was encrypted successfully |
|---|---|
| 1 |