Field types
Seven interactive field types are supported. Every field tag follows the pattern:
[fieldType, name, ...field-specific args, width|height]
The name slot is the field identifier exposed to PDF readers, Word, and any downstream form-data extraction. Pick descriptive names — they show up in form-data exports.
Text field
A single-line text input.
[textfield, name, defaultValue, width|height]
| Slot | Description |
|---|---|
name | Unique field name |
defaultValue | Pre-filled text. Use empty string for blank, or wrap in single quotes for $data refs |
width|height | Field dimensions in points |
{ "p": "Full Name: [textfield, fullName, John Doe, 200|20]" }
{ "p": "Email: [textfield, email, , 250|20]" }
Text area
A multi-line text input for longer content.
[textarea, name, defaultValue, width|height]
{ "p": "Additional notes:[br][textarea, notes, , 400|80]" }
{ "p": "[textarea, comments, Enter your feedback here, 350|60]" }
Checkbox
A boolean toggle.
[checkbox, name, checked, width|height]
| Slot | Description |
|---|---|
name | Unique field name |
checked | Initial state: true or false |
width|height | Checkbox dimensions in points (typically square, 14–16) |
{ "p": "[checkbox, termsAccepted, false, 16|16] I accept the terms and conditions" }
Used for checklists:
{ "p": "[checkbox, item1, true, 14|14] Background check complete" }
Radio button
A selectable button within a mutually-exclusive group.
[radio, name, group, selected, width|height]
| Slot | Description |
|---|---|
name | Unique field name (each radio has its own) |
group | Group name — radios sharing a group are mutually exclusive |
selected | true or false |
width|height | Radio dimensions in points (typically square, 14) |
{ "p": "[radio, optionA, paymentMethod, true, 14|14] Credit Card" }
{ "p": "[radio, optionB, paymentMethod, false, 14|14] Bank Transfer" }
{ "p": "[radio, optionC, paymentMethod, false, 14|14] Cheque" }
Selecting one automatically clears the others in the same group.
Choice field (dropdown)
A dropdown selection from predefined options.
[choicefield, name, opt1|opt2|opt3, selectedIndex, width|height]
| Slot | Description |
|---|---|
name | Unique field name |
options | Pipe-separated option list |
selectedIndex | Zero-based index of the initially selected option |
width|height | Field dimensions in points |
{ "p": "Service Level: [choicefield, serviceLevel, Economy|Standard|Express|Next-Day, 1, 150|20]" }
In this example, "Standard" (index 1) is initially selected.
List box
A scrollable list of options with optional multi-select.
[listbox, name, opt1|opt2|opt3, defaultValue, multi, width|height]
| Slot | Description |
|---|---|
name | Unique field name |
options | Pipe-separated option list |
defaultValue | Default selected value (in single quotes; empty '' for none) |
multi | true to allow multiple selections, false for single |
width|height | Field dimensions in points |
{ "p": "Skills: [listbox, skills, Python|Java|Go|Rust, '', true, 150|60]" }
Date picker
A text field that PDF readers render with a calendar widget.
[datepicker, name, defaultValue, width|height]
| Slot | Description |
|---|---|
name | Unique field name |
defaultValue | Pre-filled date (ISO 8601: YYYY-MM-DD) or empty string |
width|height | Field dimensions in points |
{ "p": "Effective date: [datepicker, effectiveDate, 2026-01-01, 140|22]" }
Approval form — putting it all together
{
"content": [
{ "h2": "Approval Form" },
{ "p": "Reviewer: [textfield, reviewer, , 250|22]" },
{ "p": "Department: [choicefield, dept, Engineering|Legal|Finance, 0, 200|22]" },
{ "p": "Decision:" },
{ "p": "[radio, approve, decision, false, 14|14] Approved" },
{ "p": "[radio, reject, decision, false, 14|14] Rejected" },
{ "p": "[radio, defer, decision, false, 14|14] Deferred" },
{ "p": "[checkbox, final, false, 14|14] This decision is final and binding" },
{ "p": "Effective: [datepicker, effective, , 140|22]" },
{ "p": "Notes:[br][textarea, notes, , 400|80]" }
]
}