Skip to main content
A newer version of this page is available. .

Fill Interactive Forms

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

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 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.