Skip to main content

Interface: TextFieldOptions

Options for creating a text form field.

Properties

PropertyTypeDescription
actions?FieldActionsJavaScript actions attached to this field's /AA dictionary. Each action value is raw PDF JavaScript source code.
appearance?stringCustom appearance stream content. When provided, this raw PDF content stream is used instead of the auto-generated appearance for the /N (normal) appearance state. Example: "1 0 0 rg 0 0 16 16 re f"
borderWidth?numberAnnotation or field border width in PDF points.
color?ColorInputColor used for drawing, text, or highlighting.
description?stringField description, emitted as /TU (the field's user-facing name). Assistive technology reads it as the field's accessible name, and it satisfies the "form fields have a description" accessibility check.
encrypt?booleanWhether the field value follows document encryption. When false, the field value is not encrypted (useful for searchable fields). Defaults to true (follow document encryption).
font?FontNameFont used to render text.
fontSize?numberFont size in PDF points.
heightnumberHeight in PDF points.
multiline?booleanWhether the text field accepts multiple lines.
readOnly?booleanWhether the form field is read-only.
required?booleanWhether the form field is required.
richValue?stringRich text value (XML string in XFA rich text format). When set, emitted as /RV in the field dictionary.
structure?PdfStructureOptionsAdditional structure metadata for tagged PDF output.
tag?"Annot" | "Artifact"Structure tag used for tagged PDF output.
value?stringCurrent or default value for the option.
widthnumberWidth in PDF points.
xnumberHorizontal position in PDF points.
ynumberVertical position in PDF points.