SetEmbeddedFileAssociated
Associated files, attachments, document editing
Description
Adds an existing embedded file to the document catalog /AF array or removes its catalog association without removing the embedded payload
Syntax
Delphi
Function TPDFlib.SetEmbeddedFileAssociated(EmbeddedFileIndex, Associated: Integer; Const Relationship: WideString): Integer;ActiveX
Function PDFlib::SetEmbeddedFileAssociated(EmbeddedFileIndex As Long, Associated As Long, Relationship As String) As LongDLL
int DLSetEmbeddedFileAssociated(int InstanceID, int EmbeddedFileIndex, int Associated, const wchar_t* Relationship);
int DLSetEmbeddedFileAssociatedA(int InstanceID, int EmbeddedFileIndex, int Associated, const char* Relationship);Parameters
| EmbeddedFileIndex | One-based index of the embedded file in the document EmbeddedFiles name tree |
|---|---|
| Associated | 1 adds the catalog /AF association, 0 removes it; other values are rejected |
| Relationship | Relationship name written to /AFRelationship when adding; must be one of Source, Data, Alternative, Supplement or Unspecified |
Return values
Returns 1 on success or 0 for an invalid index, flag, or relationship
Remarks
Associated is 0 or 1
When adding, Relationship must be one of the five standard associated-file relationship names
Removing the association preserves /AFRelationship so embedded-file accessibility metadata remains intact