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

DynaPDF Manual - Page 359

Previous Page 358   Index   Next Page 360

Function Reference
Page 359 of 750
src += (len +1);
// Skip over the null-terminator
// This can not cause a buffer overrun because of the two
// null-terminators at the end of the string.
len = strlen(src);
If the string length that was returned by the standard C function strlen() is shorter than the length
that was returned by GetFieldExpValue(), multiple values are selected in the list box.
The code above writes the values to a file and adds an EOL after each value. This is just an example
to see how the string can be parsed.
The export values of check boxes and combo boxes are not terminated with two null-terminators.
Try to parse the export value only if the field is a list box. The field type can be determined with the
functions GetFieldType(), GetFieldEx() or GetPageFieldEx().
Return values:
If the function succeeds the return value is the string length excluding the last null-terminator(s). If
the function fails the return value is a negative error code.
SI32 pdfGetFieldExpValueEx(
const PPDF* IPDF,
// Instance pointer
UI32 AField,
// Field handle
UI32 ValIndex,
// Value index
char* ADDR Value,
// Index value
char* ADDR ExpValue, // Index export value
LBOOL ADDR Selected) // Is the value selected?
This function can be used to enumerate the choice values of a combo box, list box, or radio button. If
the field is a check box, the parameter ValIndex will be ignored and the export value and selected
state are returned. The parameters Value and ExpValue hold pointers to the original null-terminated
string values. These values must not be changed or freed in your application. Note that either the
parameter Value or ExpValue can be set to NULL depending on the field type.
To enumerate the choice values of a combo box or list box call GetFieldExpValCount() to determine
the number of available values. The parameter ValIndex can then be used to access each value /
export value pair within the array.
Beginning with PDF 1.5 choice values of combo and list boxes can be in Unicode format. Because
Unicode strings are not supported by this function the function GetFieldChoiceValue() should be
used to enumerate choice values of these field types.

Previous topic: GetFieldExpValue

Next topic: GetFieldFlags