DynaPDF Manual - Page 393

Previous Page 392   Index   Next Page 394

Function Reference
Page 393 of 839
void* ToolTip;
// Tool tip if any
LBOOL UniToolTip;
// If True, ToolTip is a Unicode string
UI32 ToolTipLen;
// String length in characters
};
The function retrieves the most important properties of a field. This function is marked as obsolete,
please use GetFieldEx() instead. The parameter AHandle must be a valid field handle. The parameter
Handle must be a valid field handle. Field handles are simple array indexes into the field array of the
global AcroForm object. To enumerate all fields of a document execute the function in a loop from 0
though GetFieldCount() -1.
Field colors are returned in the native color space of the field.
Since Acrobat 6 field names can be defined as Ansi or Unicode strings. To determine whether the
string is in Ansi or Unicode format compare the string length with the member FieldNameLen as
follows (C/C++):
TPDFField f;
if (!pdfGetField(pdf, aField, &f)) return 1;
if (f.FieldName && strlen(f.FieldName) != f.FieldNameLen)
{
// We have an Unicode name!
UI16* nameW = (UI16*)f.FieldName;
}
Delphi:
The Delphi interface contains a special function to convert the returned Ansi string back to Unicode:
if not pdf.GetField(aField, f) then Exit;
if f.FielNameLen > 0 and StrLen(f.FieldName) <> f.FieldNameLen then begin
// Use the function ToUnicode of the class TPDF to convert the string
// back to Unicode
nameW := pdf.ToUnicode(f.FieldName, f.FieldNameLen * 2);
end;
There is no need to check the string format in Visual Basic, VB .Net or C# because a maybe required
conversion is automatically applied.
Remarks:
It is also possible to enumerate the fields on a per page basis with GetPageField(). The export values
of combo and list boxes can be accessed with GetFieldExpValueEx().
Return values:
If the function succeeds the return value 1 and the structure Field is filled with values. If the function
fails the return value is 0.
 

Previous topic: GetErrorMode, GetField (obsolete)

Next topic: GetFieldBackColor, GetFieldBorderColor, GetFieldBorderStyle