Create AcroForm - Create Fillable PDF in C#

The following code snippet also work with Aspose.PDF.Drawing library.

Create form from scratch

Add Form Field in a PDF Document

The Document class provides a collection named Form which helps you manage form fields in a PDF document.

To add a form field:

  1. Create the form field you want to add.
  2. Call the Form collection’s Add method.

Adding TextBoxField

Below example shows how to add a TextBoxField.

Adding RadioButtonField

The following code snippets show how to add RadioButtonField in a PDF document.

TextBoxField can be added with some widget annotations.

The following code snippet shows the steps to add RadioButtonField with three options and place them inside Table cells.

Adding Caption to RadioButtonField

Following code snippet shows how to add caption which will be associated with RadioButtonField:

Another variant for adding grouped Checkboxes

The following code snippets show how to add Grouped checkBox fields in a PDF document.

Adding ComboBox field

The following code snippets show how to add ComboBox field in a PDF document.

Adding CheckboxField

The following code snippet show how to add CheckboxField in a PDF document.

Adding ListBoxField

The following code snippet show how to add ListBoxField in a PDF document.

Using SignatureField

The following code snippet show how to sign a PDF document by SignatureField.

Add Tooltip to Form Field

The Document class provides a collection named Form which manages form fields in a PDF document. To add a tooltip to a form field, use the Field class AlternateName. Adobe Acrobat uses the ‘alternate name’ as a field tooltip.

The code snippets that follow show how to add a tooltip to a form field, first using C# and then Visual Basic.