๐ 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");
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