DynaPDF Manual - Page 228

Previous Page 227   Index   Next Page 229

Function Reference
Page 228 of 777
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:
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).
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.
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
// Predefined column, no collection item required
// Predefined column, no collection item required
// Predefined column, no collection item required

Previous topic: CreateColItemString, CreateCollection

Next topic: CreateComboBox