SetCollectionItemValue
Attachments, Document properties
Description
Fills one custom portfolio column for one attachment.
For a column declared as numeric, Value must be a finite PDF decimal number with an optional sign and a period as the decimal separator; exponent notation, grouping separators, surrounding whitespace, and locale-specific formats are rejected
Accepted decimal tokens retain their supplied precision; invalid numeric input returns failure without replacing the existing value
Syntax
Delphi
Function TPDFlib.SetCollectionItemValue(Const FileName, FieldKey, Value: WideString): Integer;Parameters
| FileName | Title the attachment was registered under with AddFileAttachment. |
|---|---|
| FieldKey | Key of a field declared with AddCollectionField. |
| Value | Value shown in that column for this attachment. |
Return values
| 0 | Empty arguments, or no attachment is registered under that name. |
|---|---|
| 1 | The value was written. |
Remarks
Values live in the file specification's collection item dictionary, so they travel with the attachment. Only attachments registered in the embedded files name tree can be addressed; embedding a file alone is not enough.
Example
PDF.SetCollectionItemValue('invoice.xml', 'Dept', 'Finance');