DynaPDF Manual - Page 73
Previous Page 72 Index Next Page 74
Interactive Forms
Page 73 of 860
The page indexes of new or imported fields start always at index 1000. The indexes of
annotations start at 10000. Form fields are in fact Widget Annotations and all annotations of a
page are stored in the same array.
Because the indexes of form fields start at index 1000 it is easier to move a field to the beginning
of the array because the indexes from 0 to 999 are free when starting to change the tab order.
The page indexes can be set to any value with SetFieldIndex(), but no field or annotation of a
page should use the same index. No error occurs if two fields or annotations use the same index
but the order of these fields is then of course undefined.
When all indexes are set, the fields must be sorted with SortFieldsByIndex() so that the new
tabulator order can be applied. Note that the function sorts the fields of the current open page.
If no open page is in memory then the function will fail.
Field Names
Interactive Form Fields are identified over the field name in a viewer application. A field name
is an Ansi string that should be human readable. Beginning with PDF 1.5 field names can also
be defined as Unicode string. However, all functions to create new fields in DynaPDF support
Ansi strings only. All characters within the Ansi character set (code page 1252) can be used with
exception of the period character (.) and characters below index 32 .
A field name should also not end with a space character because Adobe's Acrobat is then
sometimes unable to access such a field with a JavaScript Action or function.
The period (.) is a reserved character because it is used to build the fully qualified field name in
a viewer application. The fully qualified field name is constructed from the partial field name of
the field and all of its ancestors.
For a field with no parent group field, the partial and fully qualified names are the same. For a
field that is the child of another field, the fully qualified name is formed by appending the child
field’s partial name to the parent’s fully qualified name, separated by a period, e.g.
Address.Street.
Fields with identical names
It is possible to create two or more fields of the same type which use all the same name. Such
fields contain always the same value if the value of one field of the group is changed.
Fields with identical names are internally represented as a special type of field group, which is
automatically created by DynaPDF. This makes the handling more complicated because the
children of such a group do not contain a field name. The name is set to the parent's group field
but not to the children of the group. This can normally be ignored but when enumerating fields
with GetField() or GetPageField() you must consider that not all fields contain a name, the
parent field's handle is set instead.
Previous topic: How to create a Field Group?, How to change the tabulator order?
Next topic: Actions