Interface IFormField
Form field object with embedded annotation
Inherited Members
Namespace: IronSoftware.Forms
Assembly: IronPdf.dll
Syntax
public interface IFormField : IFormFieldObject, IFormFieldAnnotationObject, IPdfDocumentObject, IPdfDocumentObject, IDocumentObject
IFormField is what you receive when you read fields from an existing PDF form in IronPDF. Whether the field is a text input, a checkbox, a radio button, a combo box, a signature field, or an image field, the library returns it through this interface so the same code path can fill, read, or audit any field type. Cast to the concrete class (TextFormField, SignatureFormField, ImageFormField, and the checkbox, radio, and combo-box field types) only when type-specific behavior is needed, such as toggling a radio-button selection or inspecting choice lists on a combo-box field.
The interface sits on the editing side of the workflow. After loading a PDF, the form field collection on PdfDocument.Form exposes every field as IFormField. FindFormField returns one IFormField for a given name, and iterating the collection yields IFormField items, which is what keeps a single code path viable whether the field holds text, a choice, or a signature. Finding fields by name and assigning their values is shown step by step in the edit PDF forms how-to.
Most of the useful surface is inherited from parent contracts including IFormFieldObject. Three members carry the everyday usage: read Name or FullName to identify a field, check ReadOnly before assigning, and set Value to fill it. The interface itself declares one method, SetDefaultFont(string FontName, int FontSize, Color FontColor), which sets the font for the field and any associated annotations; fonts applied to specific annotations override this setting.
using IronPdf;
// Load an existing PDF that contains form fields
PdfDocument pdf = PdfDocument.FromFile("application.pdf");
// FindFormField returns IFormField regardless of the underlying concrete type,
// so the same code path works for text, checkbox, radio, combo, signature,
// and image form fields.
IFormField nameField = pdf.Form.FindFormField("FullName");
if (nameField != null && !nameField.ReadOnly)
{
nameField.Value = "Jane Doe";
}
pdf.SaveAs("application-filled.pdf");For collection-wide operations on the same fields, such as enumeration, removal, and bulk font configuration through SetFormFont and DisableFormFontFallback, see FormFieldCollection.
Methods
SetDefaultFont(String, Int32, Color)
Set the default font to be used by this form field and any associated annotations
Declaration
void SetDefaultFont(string FontName, int FontSize, Color FontColor)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | FontName | Font name with weight. Example "AdobeThai-Bold" |
| System.Int32 | FontSize | Font size (whole integer such as 12 or 24) |
| System.Drawing.Color | FontColor | Font color (only R, G, and B are used) |
Remarks
This option may be overwritten by fonts applied to specific form field annotations