SetEncryptedPayloadFromFile

Security and encryption

Description

Stores the complete bytes of an encrypted PDF file as the associated payload of the selected unencrypted PDF

Syntax

Delphi

Function TPDFlib.SetEncryptedPayloadFromFile(Const FileName, Subtype, PayloadVersion: WideString): Integer;

ActiveX

Function PDFlib::SetEncryptedPayloadFromFile(FileName As String, Subtype As String, PayloadVersion As String) As Long

DLL

int DLSetEncryptedPayloadFromFile(int InstanceID, const wchar_t* FileName, const wchar_t* Subtype, const wchar_t* PayloadVersion);

Parameters

FileNamePath to the complete encrypted PDF payload
SubtypePDF name identifying the encryption handler, such as Standard
PayloadVersionOptional PDF name identifying the handler version

Return values

1The payload was added
0The file, metadata, selected document, or wrapper state was invalid

Remarks

The wrapper uses PDF 2.0 /EncryptedPayload, /AF, /EmbeddedFiles, and a hidden collection whose initial document is the payload

The outer document must remain unencrypted and cannot enable PDF MAC; only one encrypted payload is permitted

See also

SetEncryptedPayloadFromString, SetEncryptedPayloadFromVariant, IsUnencryptedWrapper