SetCollectionView
Attachments, Document properties
Description
Turns the document's attachments into a PDF portfolio and selects how a viewer presents it.
Syntax
Delphi
Function TPDFlib.SetCollectionView(View: Integer; Const InitialFile: WideString): Integer;Parameters
| View | 0 detail list, 1 tiles, 2 hidden (the cover page shows and the package is reached through the attachment pane). |
|---|---|
| InitialFile | Name of the embedded file the viewer opens first, or an empty string for none. |
Return values
| 0 | Invalid view value, or no document is selected. |
|---|---|
| 1 | The collection was created or updated. |
Remarks
Collections (ISO 32000-1 12.3.5) are the PDF-native way to ship a set of related documents as one package: a claim with its photos, a filing with its exhibits, an invoice with its supporting data. The call creates the catalog /Collection dictionary on demand and raises the document to PDF 1.7. Attachments have to be registered through AddFileAttachment so they appear in the package.
Example
ID:= PDF.AddEmbeddedFile('invoice.xml', 'text/xml');
PDF.AddFileAttachment('invoice.xml', ID);
PDF.SetCollectionView(1, 'invoice.xml'); // tilesSee also
AddCollectionField, SetCollectionSort, SetCollectionItemValue, GetCollectionView, AddFileAttachment