DynaPDF Manual - Page 373

Previous Page 372   Index   Next Page 374

Function Reference
Page 373 of 787
or SetFieldExpValue(). If the field is a check box, the return value is always 1 because check boxes
do 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.
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:
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;

Previous topic: Optional Content, GetFieldEx2, GetFieldExpValCount

Next topic: GetFieldExpValueEx

Start Chat