Crionics LOGO

TUTORIALS

 

 Template Tutorial:
Understanding the form fields object structure

As easy as 1, 2, 3...

 

Introduction

Form fields are dynamic elements similar to HTML form fields: they provide an easy way to update PDF contents without the need to regenerate the whole document.

There are currently seven different types of form fields defined for PDF documents:

Name Preview
TextField

CheckBoxField
RadioButtonField
ComboBoxField
ListBoxField
ButtonField
SignatureField

 

Implementation

The implementation of form fields in the API is presented in the image below.

As with HTML form fields, PDF form fields have two main properties - as follows:

Name Apart from special situations, each form field is uniqualy identified by its name in a PDF document.
Value The current value of a form field.

 

Implementation

Accessing existing form fields via the API will always be done via the template module - as follows:

// Load the template module:
TemplateModule template = doc.getTemplateModule();

// Recover the form field named "Text":
AbstractField myField= template.getField("Text");

Upon modification of the form fields' values or attributes (see How to fill form fields), the API will update the internal structure of the form fields and, depending on the appearance generation setup (see Appearance generation), will also generate a visual representation of the new form field state.


© 2000-2007 Crionics Inc. Report issues with this page