Skip to content
LpdfDocsv0.36-r1119.4

Lpdf is pre-release. The XML schema and SDK APIs can change between releases.

Field

Creates an interactive PDF form element. Fields are only active in PDF viewers that support AcroForm (Adobe Acrobat, most desktop viewers).

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
<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>
<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>
<field type="dropdown" name="country"
options="United States,Canada,United Kingdom,Australia"
width="l" height="24pt"/>
<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>