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

FileNameTitle the attachment was registered under with AddFileAttachment.
FieldKeyKey of a field declared with AddCollectionField.
ValueValue shown in that column for this attachment.

Return values

0Empty arguments, or no attachment is registered under that name.
1The 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');

See also

AddCollectionField, AddFileAttachment