Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

DynaPDF Manual - Page 49

Previous Page 48   Index   Next Page 50

Interactive Forms
Page 49 of 750
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.
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
Get/SetFieldHighlightMode() // Field highlight mode
Get/SetFieldIndex()
// Index to change the tab order
Get/SetFieldFlags()
// Field flags
Get/SetFieldMapName()
// Mapping name -> export name
Get/SetFieldName()
// Field name
Get/SetFieldOrientation()
// Field orientation
Get/SetFieldTextAlign()
// Text alignment of a text field
 

Previous topic: Field Appearance

Next topic: What is a Group Type?