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

DynaPDF Manual - Page 358

Previous Page 357   Index   Next Page 359

Function Reference
Page 358 of 750
not support multiple export values. However, this function is normally used to determine the
number of available choice values within a combo box or list box because only these field types
support multiple choice values. See also GetFieldExpValueEx().
Return values:
If the function succeeds the return value is the number of values/export values which are defined for
a field. If the function fails the return value is a negative error code.
GetFieldExpValue
Syntax:
SI32 pdfGetFieldExpValue(
const PPDF* IPDF,
// Instance pointer
UI32 AField,
// Field handle
char* ADDR Value)
// Field's export value
This function retrieves the export value(s) of a check box, list box, or combo box. The parameter
AField must be a valid field handle of a check box, list box or combo box. The parameter Value holds
a pointer to the original export value. The retrieved string value must not be changed or freed in
your application.
The export value of a check box can be either "Off" if the check box is not selected or an arbitrary
string when the check box is selected.
The export value of a combo box or list box can be NULL when no value is selected.
Since Acrobat 5, list boxes support multiple selected values. In this case the export values are
delimited by a null-character (0); the last value is terminated with two null-characters. Note that the
returned string length is the length without the last two null-terminators.
The export values of a list box that has three selected values are returned as follows:
"Value1\0Value2\0Value3\0\0"
The returned string length would be 20 characters in this example.
To extract the values proceed as follows:
SI32 valLen;
char* src, *value = NULL;
// aField must be a handle of list box in this example
valLen = pdfGetFieldExpValue(pdf, aField, value);
SI32 len = strlen(value); // Get the string length
if (valLen > 0 && len < valLen)
{
src = value;
do
{
fwrite(src, 1, len, f);
fwrite("\r\n", 1, 2, f);
 

Previous topic: GetFieldExpValCount

Next topic: GetFieldExpValueEx