Fill Interactive Forms

  • 2 minutes to read

This document describes how to fill a document with interactive forms and customize form field behavior.

Overview

You are able to type directly into PDF documents that contain the form field information.

InteractiveForm

As you can see from the image above, each field is rendered according to its form type, providing text boxes, radio buttons and combo boxes with auto complete, check boxes and lists.

The image below shows the auto complete, combo box and check box features embedded in an address form.

InteractiveFormFilelds

Customization

Highlight Form Fields

The PDF Viewer can highlight interactive form fields with a color. To enable this functionality, set the PdfViewer.HighlightFormFields property to true.

If you wish to change the default color, which is used to highlight form fields, use the PdfViewer.HighlightedFormFieldColor property.

The image below shows a form field highlighted with a red color.

HighlightFormFieldColor_Red

Change Form Field's Value

To specify a new value of the form field, use the PdfFormFieldValueChangingEventArgs.NewValue property when the PdfViewer.FormFieldValueChanging event is handled.

After a form field value is changed, the PdfViewer.FormFieldValueChanged event is raised. The PdfFormFieldValueChangedEventArgs.FieldName, PdfFormFieldValueChangedEventArgs.OldValue and PdfFormFieldValueChangedEventArgs.NewValue properties allow you to obtain the field name, the field's previous value and new value.

When a form field receives or loses the input focus, the PdfViewer.FormFieldGotFocus or PdfViewer.FormFieldLostFocus event is raised. In one of these events you can obtain a field name using the PdfFormFieldFocusEventArgs.FieldName property.