Interactive Form Filling

  • 2 min to read

This document describes how to fill a document with interactive forms and provides customization options.

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 Field

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

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

The image below demonstrates the PdfViewerControl.HighlightedFormFieldColor property set to Color.FromArgb(120, 255, 0, 0).

HighlightFormFieldRedColor

Change Form Field Value

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

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

When a form field receives the input focus, the form field's editor is activated and the PDF Viewer raises the PdfViewerControl.ShowingEditor event. In this event, you can prevent end-users from showing the form field's editor using the PdfShowingEditorEventArgs.Cancel property. When this property is enabled, end-users can't edit the form field value.

After the form field's editor has been shown the PdfViewerControl.ShownEditor event is raised. When the form field loses the input focus the PDF Viewer raises the PdfViewerControl.HiddenEditor event.

You can obtain a form field name using the PdfEditorEventArgsBase.FieldName property when the PDF Viewer raises the PdfViewerControl.ShowingEditor, PdfViewerControl.ShownEditor or PdfViewerControl.HiddenEditor event.

See Also