Table of Contents

Class PdfFormField

Namespace
PDiffy
Assembly
PDiffy.dll

A form field. Name is the full name, parent names joined with dots (address.city). AccessibleName is what a screen reader announces for it.

public sealed record PdfFormField : IEquatable<PdfFormField>
Inheritance
PdfFormField
Implements
Inherited Members

Properties

AccessibleName

The field's tooltip text (/TU), which a screen reader announces; null when it has none.

public string? AccessibleName { get; init; }

Property Value

string

Alignment

How text in the field lines up; left unless the field, a widget or the form says otherwise.

public PdfFormFieldAlignment Alignment { get; init; }

Property Value

PdfFormFieldAlignment

DefaultValue

The value a reset puts back.

public string? DefaultValue { get; init; }

Property Value

string

ExportValues

The values a check box or radio button sends when it's on, one per widget, such as Yes.

public IReadOnlyList<string> ExportValues { get; init; }

Property Value

IReadOnlyList<string>

Flags

The options set on the field. Only those that apply to its Type are read.

public PdfFormFieldFlags Flags { get; init; }

Property Value

PdfFormFieldFlags

MaxLength

The most characters a text field takes, or its parent's limit; null when there's no limit.

public int? MaxLength { get; init; }

Property Value

int?

Name

The field's full name, or (unnamed) when neither it nor its parents have one.

public required string Name { get; init; }

Property Value

string

Options

The text shown for each choice of a combo box or list box, in order; empty when there are none.

public IReadOnlyList<string> Options { get; init; }

Property Value

IReadOnlyList<string>

Page

The page number, from 1, of the field's first widget; null when its page can't be found.

public int? Page { get; init; }

Property Value

int?

Scripts

The field's JavaScript: its own scripts, then each widget's, each in PdfFormScriptTrigger order, and any script chained after another is listed under the same trigger.

public IReadOnlyList<PdfFormScript> Scripts { get; init; }

Property Value

IReadOnlyList<PdfFormScript>

Signature

The signature in a signed signature field; null for other fields and unsigned ones.

public PdfSignature? Signature { get; init; }

Property Value

PdfSignature

TextColor

The color of text typed into the field, written like a layout color (gray:0, #ff0000).

public string? TextColor { get; init; }

Property Value

string

TextFont

The font of text typed into the field, as the PDF names it (Helvetica), or the form's local name for it (F1) when the form's fonts don't define it.

public string? TextFont { get; init; }

Property Value

string

TextSize

The size of text typed into the field, in points; 0 means the viewer fits the text to the field.

public double? TextSize { get; init; }

Property Value

double?

Type

What kind of control the field is.

public PdfFormFieldType Type { get; init; }

Property Value

PdfFormFieldType

Value

The field's value as text, or its parent's when it sets none; null when there's none. A check box or radio button holds the name of the state it's in (Off or an export value), and a list with several choices picked joins them with ", ".

public string? Value { get; init; }

Property Value

string

WidgetAltText

The alt text on the Form element that tags the field's first widget. PDF/UA accepts it in place of a tooltip when every widget's Form element has alt text; null when any of them has none. Snapshots leave it out, since the structure section prints it.

public string? WidgetAltText { get; init; }

Property Value

string