DynaPDF Manual - Page 245

Previous Page 244   Index   Next Page 246

Function Reference
Page 245 of 818
Make sure that you use exactly the same key to create the collection items and that the right data
type is used.
Use the function SetColSortField() to sort the list of embedded files by a specific collection field.
It is usually best to check the validity of the collection with CheckCollection() after it was fully
created. This is especially important if multiple collections were merged into one file.
The order in which collection fields and collections items are created can be arbitrary. The collection
items can be created before the collection fields and vice versa.
This function is implemented in an Ansi and Unicode compatible variant. The relationship between
collection fields and collection items is explained in more detail under CreateCollection(). DynaPDF
contains also 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.
Return values:
If the function succeeds the return value is the handle of the collection field, a value greater or equal
zero. If the function fails the return value is a negative error code.
SI32 pdfCreateComboBox(
const PPDF* IPDF, // Instance pointer
const char* Name, // Name of combo box
// Sort the choice values
SI32 Parent,
// Parent group field or -1
double PosX,
// X-Coordinate of the combo box
double PosY,
// Y-Coordinate of the combo box
double Width,
// Width of the combo box
double Height)
// Height of the combo box
This function creates a combo box. The choice values of the combo box must be added with the
function AddValToChoiceField(). This function requires the field handle that was returned by this
A combo box can contain value that is not included in the array of choice values. This value can be
used to display a string in the combo box when no choice value is selected, e.g. "Select a value!".
The field value can be set with the function SetFieldExpValue() as follows:
The parameter ValIndex of the function SetFieldExpValue() must be set to PDF_MAX_INT and the
parameter Value must contain the wished value or NULL. If Value is NULL or an empty string, a
maybe existing field value will be deleted. The choice values of the combo box get the state
unselected when setting a field value in this way.

Previous topic: CreateCollectionField

Next topic: CreateDeviceNColorSpace

Start Chat