Frameworks
Integrations
Mendix
SharePoint
Modular UI
Legacy UI
AnnotationManager
Annotation Types
Customize
Version 11
Version 10
v10.12
v10.11
v10.10
v10.9
v10.8
v10.7
v10.6
v10.5
v10.4
v10.3
v10.2
v10.1
v10.0
Version 8
v8.12
v8.11
v8.10
v8.9
v8.8
v8.7
v8.6
v8.5
v8.4
v8.3
v8.2
v8.1
v8.0
Version 7
Version 6
v6.3
v6.2
v6.1
v6.0
Version 5
Version 4
Version 3
Version 2
WebViewer Server
WebViewer BIM
Form fields, also known as AcroForms, are a collection of fields such as text boxes, checkboxes, radio buttons, drop-down lists, push buttons, and more that will gather information interactively from the user.
One of the most important ideas to understand is the appearance (how it is displayed) of a form field is independent of the field itself and exists as a widget annotation. In fact, there can be multiple widget annotations for a single field. This gives the freedom to present a field appearance over multiple pages or even multiple times on the same page of a document.
Annotations and fields should be added to the document only after the document has finished loading. This can be done by listening for the DocumentViewer.documentLoaded event:
Text fields and widget annotations can be added programmatically. There are several properties and widget flags as highlighted below:
Widget Flag | Description | Unique to text? |
---|---|---|
READ_ONLY | The field value cannot be changed. | No |
REQUIRED | The field must have a value when exported. | No |
MULTILINE | The field may contain multiple lines of text. | Yes |
COMB | The field shall be automatically divided into as many equally spaced positions as the value of the max length. | Yes |
DO_NOT_SCROLL | The field shall not scroll (horizontally for single-line fields, vertically for multiple-line fields) to accommodate more text than fits within its annotation rectangle. | Yes |
DO_NOT_SPELL_CHECK | The field text shall not be spell-checked. | Yes |
Signature fields and widget annotations can be added programmatically. There are several properties and widget flags as highlighted below:
Widget flag | Description | Unique to signature? |
---|---|---|
READ_ONLY | The field value cannot be changed. | No |
REQUIRED | The field must have a value when exported. | No |
Checkbox fields and widget annotations can be added programmatically. There are several properties and widget flags as highlighted below:
Caption | Value | Result |
---|---|---|
Check |
| |
Circle |
| |
Cross |
| |
Diamond |
| |
Square |
| |
Star |
|
Widget flag | Description | Unique to checkbox? |
---|---|---|
READ_ONLY | The field value cannot be changed. | No |
REQUIRED | The field must have a value when exported. | No |
Combobox (choice) fields and widget annotations can be added programmatically. There are several properties and widget flags as highlighted below:
Widget flag | Description | Unique to combobox? |
---|---|---|
READ_ONLY | The field value cannot be changed. | No |
REQUIRED | The field must have a value when exported. | No |
COMBO | The field is a combobox. Must be true. | No |
MULTI_SELECT | The field can have multiple selected values. | No |
EDIT | If true, the combobox will include an editable text box with a dropdown. | Yes |
Listbox fields and widget annotations can be added programmatically. There are several properties and widget flags as highlighted below:
Widget flag | Description | Unique to listbox? |
---|---|---|
READ_ONLY | The field value cannot be changed. | No |
REQUIRED | The field must have a value when exported. | No |
COMBO | The field is a listbox. Must be false. | No |
MULTI_SELECT | The field can have multiple selected values. | No |
Radio button fields and widget annotations can be added programmatically. There are several properties and widget flags as highlighted below:
Widget flag | Description | Unique to radio? |
---|---|---|
READ_ONLY | The field value cannot be changed. | No |
REQUIRED | The field must have a value when exported. | No |
RADIO | This must be true otherwise it is a checkbox. | No |
NO_TOGGLE_TO_OFF | If true only one radio button can be selected. | Yes |
For form fields that expect a date to be input, WebViewer provides an interactive date picker widget to select a date from a calendar. Users can still type the date, but the date field can also be populated by using the calendar.
The calendar will automatically set the correct date format for the field so the user doesn't need to worry about entering the date in a specific format.
Date picker fields and widget annotations can be added programmatically. There are several properties and widget flags as highlighted below:
Widget flag | Description | Unique to date picker? |
---|---|---|
READ_ONLY | The field value cannot be changed. | No |
REQUIRED | The field must have a value when exported. | No |
Just like other PDF form fields, the date field can also be filled programmatically using the fieldManager or using the Annotations.DatePickerWidgetAnnotation instance.
Here is an example of filling date field programmatically:
The default i18n configuration format looks like this:
You must provide 12 months and 7 weekdays (with abbreviations). Always specify weekdays in this order with Sunday first. You can change the firstDay
option to reorder if necessary (0: Sunday, 1: Monday, etc). You can also set isRTL
to true for languages that are read from right-to-left.
Did you find this helpful?
Trial setup questions?
Ask experts on DiscordNeed other help?
Contact SupportPricing or product questions?
Contact Sales