DynaPDF Manual - Page 57
Previous Page 56 Index Next Page 58
Interactive Forms
Page 57 of 839
all field types with exception of barcode fields. However, in certain cases it can be useful to let
the viewer render fields with their own algorithms because the exact way how Adobe’s Acrobat
builds the field appearances is not documented.
For example, when editing the contents of a text field in Adobe’s Acrobat the viewer rebuilds
first the field appearance before placing the editing cursor into the field. The new appearance
created from Adobe’s Acrobat can be slightly different in comparison to the one that was
created by DynaPDF. The visible content, especially of text fields, is sometimes not absolutely
stable.
If the NeedAppearance flag is set, the viewer uses already its own algorithms to build the field
appearances when opening the file. This avoids visible changes when editing a field. However,
the NeedAppearance flag must not be set to true if a form contains page templates.
Important field properties when creating new fields
The line width of the field border is derived from the current graphics state when a new field is
created (see SetLineWidth()). No border will be drawn if either the line width is set to zero or if
the border color is set to NO_COLOR (see SetFieldBorderColor()). The default background color
for new fields is NO_COLOR; that means the background appears transparent. Form fields
support the color spaces DeviceGray, DeviceRGB, and DeviceCMYK. The default background,
border, and text color must be defined in the current color space. Note that DynaPDF does not
convert the current color values if the color space will be changed.
Field Properties
Most field properties and values can be read and changed with DynaPDF. The following list
gives an overview over the available functions and for what they can be used.
• AddValToChoiceField()
// List & combo boxes
• GetFieldChoiceValue()
// List & combo boxes, radio buttons
• GetFieldCount()
// Number of fields in the document
• GetFieldEx()/GetFieldEx2()
// Most important properties
• GetPageFieldCount()
// Number of fields of a page
• GetFieldExpValCount()
// Number of values/export values
• Get/SetFieldExpValue()
// Export value of a field
• GetFieldExpValueEx()
// Value and export value pair
• GetFieldGroupType()
// Base type of a field group
• GetFieldType()
// Field type
• SetAnnotOrFieldDate()
// Sets the modification date
• SetCheckBoxState()
// Changes the state of a check box
• SetCheckBoxDefState()
// Changes the default state of a check box
• Get/SetFieldHighlightMode() // Field highlight mode
• Get/SetFieldIndex()
// Index to change the tab order
• Get/SetFieldFlags()
// Field flags
• Get/SetFieldMapName()
// Mapping name -> export name
Previous topic: Interactive Forms, Field Appearance
Next topic: What is a Group Type?