Field
Creates an interactive PDF form element. Fields are only active in PDF viewers that support AcroForm (Adobe Acrobat, most desktop viewers).
Attributes
Section titled “Attributes”| Attribute | Type | Default | Description |
|---|---|---|---|
type |
string | — | Required. text checkbox dropdown radio button |
name |
string | — | Required. Field name in the PDF form |
value |
string | — | Default value |
label |
string | — | Visible label (for checkbox, radio, button) |
options |
string | — | Comma-separated options for dropdown |
group |
string | — | Radio group name |
checked |
boolean | false | Initial checked state (checkbox/radio) |
required |
boolean | false | Mark field as required |
readonly |
boolean | false | Prevent editing |
max-len |
integer | — | Maximum text length |
action-url |
URL | — | Submit URL (button) |
width |
token/length | — | Field width |
height |
token/length | — | Field height: a length, or a name from the height row of tokens |
ocg |
string | — | screen: shown only on screen. print is an error: a field in print content could be filled nowhere. See Print and screen content |
Text form
Section titled “Text form”<column gap="m"> <column gap="xs"> <text font-size="xs" color="#666666">Full name</text> <field type="text" name="full_name" width="xl" height="24pt"/> </column> <column gap="xs"> <text font-size="xs" color="#666666">Email</text> <field type="text" name="email" width="xl" height="24pt"/> </column> <field type="button" name="submit" label="Submit" action-url="https://example.com/submit"/></column>L.column({ gap: 'm' }, [ L.column({ gap: 'xs' }, [ L.text({ fontSize: 'xs', color: '#666666' }, ['Full name']), L.field({ type: 'text', name: 'full_name', width: 'xl', height: '24pt' }), ]), L.column({ gap: 'xs' }, [ L.text({ fontSize: 'xs', color: '#666666' }, ['Email']), L.field({ type: 'text', name: 'email', width: 'xl', height: '24pt' }), ]), L.field({ type: 'button', name: 'submit', label: 'Submit', actionUrl: 'https://example.com/submit' }),])L.column(ColumnAttr(gap='m'), [ L.column(ColumnAttr(gap='xs'), [ L.text(TextAttr(font_size='xs', color='#666666'), ['Full name']), L.field(FieldAttr(type='text', name='full_name', width='xl', height='24pt')) ]), L.column(ColumnAttr(gap='xs'), [ L.text(TextAttr(font_size='xs', color='#666666'), ['Email']), L.field(FieldAttr(type='text', name='email', width='xl', height='24pt')) ]), L.field(FieldAttr(type='button', name='submit', label='Submit', action_url='https://example.com/submit'))])L.column(new ColumnAttr().gap("m"), List.of( L.column(new ColumnAttr().gap("xs"), List.of( L.text(new TextAttr().fontSize("xs").color("#666666"), List.of("Full name")), L.field(new FieldAttr().type("text").name("full_name").width("xl").height("24pt")) )), L.column(new ColumnAttr().gap("xs"), List.of( L.text(new TextAttr().fontSize("xs").color("#666666"), List.of("Email")), L.field(new FieldAttr().type("text").name("email").width("xl").height("24pt")) )), L.field(new FieldAttr().type("button").name("submit").label("Submit").actionUrl("https://example.com/submit"))))L.Column(new() { Gap = "m" }, [ L.Column(new() { Gap = "xs" }, [ L.Text(new() { FontSize = "xs", Color = "#666666" }, ["Full name"]), L.Field(new() { Type = "text", Name = "full_name", Width = "xl", Height = "24pt" }), ]), L.Column(new() { Gap = "xs" }, [ L.Text(new() { FontSize = "xs", Color = "#666666" }, ["Email"]), L.Field(new() { Type = "text", Name = "email", Width = "xl", Height = "24pt" }), ]), L.Field(new() { Type = "button", Name = "submit", Label = "Submit", ActionUrl = "https://example.com/submit" }),])L::column(new ColumnAttr(gap: 'm'), [ L::column(new ColumnAttr(gap: 'xs'), [ L::text(new TextAttr(fontSize: 'xs', color: '#666666'), ['Full name']), L::field(new FieldAttr(type: 'text', name: 'full_name', width: 'xl', height: '24pt')), ]), L::column(new ColumnAttr(gap: 'xs'), [ L::text(new TextAttr(fontSize: 'xs', color: '#666666'), ['Email']), L::field(new FieldAttr(type: 'text', name: 'email', width: 'xl', height: '24pt')), ]), L::field(new FieldAttr(type: 'button', name: 'submit', label: 'Submit', actionUrl: 'https://example.com/submit')),])Checkbox
Section titled “Checkbox”<row align="center" gap="s"> <field type="checkbox" name="agree" value="yes"/> <text font-size="s" width="fill">I agree to the terms and conditions</text></row>L.row({ align: 'center', gap: 's' }, [ L.field({ type: 'checkbox', name: 'agree', value: 'yes' }), L.text({ fontSize: 's', width: 'fill' }, ['I agree to the terms and conditions']),])L.row(RowAttr(align='center', gap='s'), [ L.field(FieldAttr(type='checkbox', name='agree', value='yes')), L.text(TextAttr(font_size='s', width='fill'), ['I agree to the terms and conditions'])])L.row(new RowAttr().align("center").gap("s"), List.of( L.field(new FieldAttr().type("checkbox").name("agree").value("yes")), L.text(new TextAttr().fontSize("s").width("fill"), List.of("I agree to the terms and conditions"))))L.Row(new() { Align = "center", Gap = "s" }, [ L.Field(new() { Type = "checkbox", Name = "agree", Value = "yes" }), L.Text(new() { FontSize = "s", Width = "fill" }, ["I agree to the terms and conditions"]),])L::row(new RowAttr(align: 'center', gap: 's'), [ L::field(new FieldAttr(type: 'checkbox', name: 'agree', value: 'yes')), L::text(new TextAttr(fontSize: 's', width: 'fill'), ['I agree to the terms and conditions']),])Dropdown
Section titled “Dropdown”<field type="dropdown" name="country" options="United States,Canada,United Kingdom,Australia" width="l" height="24pt"/>L.field({ type: 'dropdown', name: 'country', options: 'United States,Canada,United Kingdom,Australia', width: 'l', height: '24pt' })L.field(FieldAttr(type='dropdown', name='country', options='United States,Canada,United Kingdom,Australia', width='l', height='24pt'))L.field(new FieldAttr().type("dropdown").name("country").options("United States,Canada,United Kingdom,Australia").width("l").height("24pt"))L.Field(new() { Type = "dropdown", Name = "country", Options = "United States,Canada,United Kingdom,Australia", Width = "l", Height = "24pt" })L::field(new FieldAttr(type: 'dropdown', name: 'country', options: 'United States,Canada,United Kingdom,Australia', width: 'l', height: '24pt'))Radio group
Section titled “Radio group”<column gap="xs"> <row align="center" gap="s"> <field type="radio" name="plan" group="plan" value="basic" checked="true"/> <text font-size="s" width="fill">Basic</text> </row> <row align="center" gap="s"> <field type="radio" name="plan" group="plan" value="pro"/> <text font-size="s" width="fill">Pro</text> </row></column>L.column({ gap: 'xs' }, [ L.row({ align: 'center', gap: 's' }, [ L.field({ type: 'radio', name: 'plan', group: 'plan', value: 'basic', checked: true }), L.text({ fontSize: 's', width: 'fill' }, ['Basic']), ]), L.row({ align: 'center', gap: 's' }, [ L.field({ type: 'radio', name: 'plan', group: 'plan', value: 'pro' }), L.text({ fontSize: 's', width: 'fill' }, ['Pro']), ]),])L.column(ColumnAttr(gap='xs'), [ L.row(RowAttr(align='center', gap='s'), [ L.field(FieldAttr(type='radio', name='plan', group='plan', value='basic', checked=True)), L.text(TextAttr(font_size='s', width='fill'), ['Basic']) ]), L.row(RowAttr(align='center', gap='s'), [ L.field(FieldAttr(type='radio', name='plan', group='plan', value='pro')), L.text(TextAttr(font_size='s', width='fill'), ['Pro']) ])])L.column(new ColumnAttr().gap("xs"), List.of( L.row(new RowAttr().align("center").gap("s"), List.of( L.field(new FieldAttr().type("radio").name("plan").group("plan").value("basic").checked(true)), L.text(new TextAttr().fontSize("s").width("fill"), List.of("Basic")) )), L.row(new RowAttr().align("center").gap("s"), List.of( L.field(new FieldAttr().type("radio").name("plan").group("plan").value("pro")), L.text(new TextAttr().fontSize("s").width("fill"), List.of("Pro")) ))))L.Column(new() { Gap = "xs" }, [ L.Row(new() { Align = "center", Gap = "s" }, [ L.Field(new() { Type = "radio", Name = "plan", Group = "plan", Value = "basic", Checked = true }), L.Text(new() { FontSize = "s", Width = "fill" }, ["Basic"]), ]), L.Row(new() { Align = "center", Gap = "s" }, [ L.Field(new() { Type = "radio", Name = "plan", Group = "plan", Value = "pro" }), L.Text(new() { FontSize = "s", Width = "fill" }, ["Pro"]), ]),])L::column(new ColumnAttr(gap: 'xs'), [ L::row(new RowAttr(align: 'center', gap: 's'), [ L::field(new FieldAttr(type: 'radio', name: 'plan', group: 'plan', value: 'basic', checked: true)), L::text(new TextAttr(fontSize: 's', width: 'fill'), ['Basic']), ]), L::row(new RowAttr(align: 'center', gap: 's'), [ L::field(new FieldAttr(type: 'radio', name: 'plan', group: 'plan', value: 'pro')), L::text(new TextAttr(fontSize: 's', width: 'fill'), ['Pro']), ]),])