๐Ÿ“‹ Interactive Forms

Text fields, checkboxes, dropdowns, and signature fields with accessible tooltips.

C# โ€” Interactive Forms
// Accessible tagged text field
var formSE = root.AddChild(StructureType.Form);
var field = new PdfAcroField(
    PdfAcroFieldType.Text, "fullName",
    72, 675, 250, 20)
{
    Tooltip = "Full name (required)", // PDF/UA
    Required = true
};
page.AddTaggedAcroField(formSE, field);

// Dropdown with options
page.AddDropdownField("country",
    72, 590, 250, 20,
    new[] { "USA", "UK", "Canada" },
    tooltip: "Select your country");

// Checkbox
page.AddCheckboxField("agree",
    72, 545, 14,
    tooltip: "Accept terms (required)",
    required: true);

// Signature field
page.AddSignatureField("sig",
    72, 480, 200, 40,
    tooltip: "Sign here");
Screenshot of the Interactive Forms PDF showing a Registration Form heading, labeled form fields for Full Name and Email with text input boxes, a Country dropdown selector, a Terms checkbox, and labels โ€” all interactive and fillable in any PDF viewer

You should see a bold "Registration Form" heading, a 250 pt wide text input box for Full Name (tooltip: "Full name (required)"), a Country dropdown defaulting to "USA", a checkbox for accepting terms, and a tall signature box. All fields are interactive โ€” click them in any PDF viewer.
File: 08_interactive_forms.pdf

โ™ฟ Accessibility Tip

Every form field must have a Tooltip (/TU) for PDF/UA compliance. Required fields should include "required" in the tooltip text. Use AddTaggedAcroField() to link fields to the structure tree.