SetEncryptedPayloadFromString

Security and encryption

Description

Stores complete in-memory encrypted PDF bytes as the payload of the selected unencrypted PDF

Syntax

Delphi

Function TPDFlib.SetEncryptedPayloadFromString(Const FileBytes: AnsiString; Const Subtype, PayloadVersion: WideString): Integer;

DLL

int DLSetEncryptedPayloadFromString(int InstanceID, const char* FileBytes, int FileLength, const wchar_t* Subtype, const wchar_t* PayloadVersion);

Parameters

FileBytesComplete binary encrypted PDF data
FileLengthDLL byte length, including any embedded zero bytes
SubtypePDF name identifying the encryption handler
PayloadVersionOptional PDF name identifying the handler version

Return values

1The payload was added
0The input or wrapper state was invalid

Remarks

The function stores bytes without decrypting or rewriting the payload and automatically raises the outer document to PDF 2.0

See also

SetEncryptedPayloadFromFile, GetEncryptedPayloadContentToString