DynaPDF Manual - Page 59

Previous Page 58   Index   Next Page 60

Interactive Forms
Page 59 of 839
When changing a value or property of a Field Group there is nothing special that must be
considered. DynaPDF sets the wished value or property automatically to the right field.
How to create a Field Group?
Field groups can be created in two ways: When creating two fields with the same name and
type then DynaPDF creates automatically a field group. However, it is also possible to set the
handle of the parent field to indicate that the field should be added to this field as a child. The
latter variant is a little bit faster.
SI32 prt = pdfCreateTextField(pdf, "Test", -1,false,-1,50, 50,150,20);
pdfCreateTextField(pdf, "Test",prt,false,-1,50, 80,150,20);
pdfCreateTextField(pdf, "Test",prt,false,-1,50,110,150,20);
// Same result but requires more processing time
pdfCreateTextField(pdf, "Test", -1, false, -1, 50,
50, 150, 20);
pdfCreateTextField(pdf, "Test", -1, false, -1, 50,
80, 150, 20);
pdfCreateTextField(pdf, "Test", -1, false, -1, 50, 110, 150, 20);
See also section "Fields with identical names".
How to change the tabulator order?
The form fields and annotations of a page are stored in an array. The order of fields in this array
represents the tab order. New fields are added to the array in the order in which they were
created. To enable the definition of an arbitrary tab order, each form field and annotation holds
a page index variable which can be used to sort the fields.
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.

Previous topic: What is a Group Type?

Next topic: Field Names, Fields with identical names