AddCollectionField
Attachments, Document properties
Description
Declares one column of the portfolio's schema.
Syntax
Delphi
Function TPDFlib.AddCollectionField(Const FieldKey, DisplayName: WideString; FieldType, Order, Visible: Integer): Integer;Parameters
| FieldKey | Internal key the column is addressed by, also used with SetCollectionItemValue. |
|---|---|
| DisplayName | Column heading shown in the viewer. |
| FieldType | 0 text, 1 date, 2 number, 3 file name, 4 description, 5 modification date, 6 creation date, 7 size. |
| Order | Column position in the viewer. |
| Visible | 1 shows the column, 0 keeps it hidden but addressable. |
Return values
| 0 | Invalid field type or empty key. |
|---|---|
| 1 | The field was declared. |
Remarks
Types 3 to 7 are filled by the viewer from the file specification itself; types 0 to 2 are custom columns whose values come from SetCollectionItemValue. Re-declaring an existing key replaces it.
Example
PDF.AddCollectionField('Dept', 'Department', 0, 1, 1);
PDF.AddCollectionField('Amount', 'Amount', 2, 2, 1);See also
SetCollectionView, SetCollectionItemValue, GetCollectionFieldCount