DynaPDF Manual - Page 55

Previous Page 54   Index   Next Page 56

Interactive Forms
Page 55 of 821
The global NeedAppearance flag of an Interactive Form defines whether the viewer should
create the field appearances on demand when opening the file or whether the existing
definitions should be taken from the PDF file. DynaPDF creates always appearance streams for
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
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.
// List & combo boxes
// List & combo boxes, radio buttons
// Number of fields in the document
// Most important properties
// Number of fields of a page
// Number of values/export values
// Export value of a field
// Value and export value pair
// Base type of a field group
// Field type
// Sets the modification date
Get/SetFieldHighlightMode() // Field highlight mode

Previous topic: Interactive Forms, Field Appearance

Next topic: What is a Group Type?