Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

DynaPDF Manual - Page 221

Previous Page 220   Index   Next Page 222

Function Reference
Page 221 of 750
collection item. Depending on the data type that was defined for a specific collection field, the
collection items can be added to the embedded files with the following functions:
CreateColItemDate()
CreateColItemNumber()
CreateColItemString()
The functions above require always the embedded file’s handle, the key, and the data for that
key. The key was defined in the prior CreateCollectionField() call. Note that the key of a
collection field is used to find the data in the embedded files file specification dictionaries. The
column name is used to display it in the user interface.
Once the collection fields and items were defined it is possible to mark one field as sort field. The
list is then sorted by this field either in ascending or descending order (see SetColSortField() for
further information).
Remarks:
DynaPDF contains example projects which demonstrate how collection fields and items can be
created. Use the function CheckCollection() to determine whether the connection between collection
fields and collection items is valid.
The container PDF should always consist of only one page that displays the compatibility message as
described above and shown in the demo projects. Collections which are created in this way are very
suitable for merging multiple collections into one file. If the container PDF is a normal PDF file,
many advantages of collections are lost. Especially merging of such files is then as difficult as with
normal PDF files.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
CreateCollectionField
Syntax:
SI32 pdfCreateCollectionField(
const PPDF* IPDF,
// Instance pointer
TColColumnType ColType, // Data type for the column
SI32 Column,
// Column index or -1, see below
const char* Name,
// Column name to be displayed in the viewer
const char* Key,
// Key to find the data for that column
LBOOL Visible,
// If false, the column is not displayed
LBOOL Editable)
// If true, the column is editable
typedef enum
{
cisCreationDate, // Predefined column, no collection item required
cisDescription,
// Predefined column, no collection item required
cisFileName,
// Predefined column, no collection item required
cisModDate,
// Predefined column, no collection item required
 

Previous topic: CreateCollection

Next topic: CreateComboBox