How to Fill Out PDF Form Input Fields
PDF forms (AcroForms) are widely used in government, business, and HR workflows. They contain interactive input fields—like text boxes, checkboxes, radio buttons, and dropdowns—that can be filled automatically using data files such as XML.
In this tutorial, you’ll learn how to map common PDF form field types to values in a data file and fill them programmatically. We’ll cover:
- Text fields (single-line and multiline) → mapped to string values in your data.
- Checkboxes → represented as
Yes/On
(checked) orOff
(unchecked). - Radio buttons → a single value from a group of options.
- Dropdowns and list boxes → mapped to the selected option string.
- Signature fields → stored as placeholders or digital signature values.
We’ll also look at how these values appear when exported to XML (XFDF), and then show how to import or generate them back into a PDF form. By the end, you’ll understand how to build data files to automatically fill out forms like W-9s, W-4s, or custom demo PDFs using the the pdfRest Import Form Data API tool.
In this tutorial, examples from the following sample forms will be used:
These files contain common form fields seen in PDF forms. To extract the form fields in a data format, all of the form data fields were filled out on each form, then the pdfRest Export Form Data API tool was used to get the form data out into XML file formats.
The list following consists of the common PDF form field inputs used in the example forms, and the example values that appear in the XML data exported from them. You can use these examples to understand the syntax and values for the data files in order to import form data to PDF forms appropriately.
1. Text Field
- Single-line or multi-line text.
AcroFormImport
<FirstMiddleLastNamemax29characters>Your Name</FirstMiddleLastNamemax29characters>
<BusinessEmailAddress>Business Email</BusinessEmailAddress>
<ResidentialStreetAddressnoPOBoxduetoUSAPATRIOTActVerification>Your Address</ResidentialStreetAddressnoPOBoxduetoUSAPATRIOTActVerification>
<MothersMaidenName>Mother's Maiden Name</MothersMaidenName>
<SSN>Your SSN</SSN>
SampleForm
<name>Name</name>
→ Text field (single-line, e.g., user’s name)<comments>Comments</comments>
→ Multiline text field (comment box)<password>password</password>
→ Password field (simulated as a text field)
2. Password Field (technically just a text field with a “password” flag)
SampleForm
<password>password</password>
3. Checkbox
- Usually has an “On” value (e.g., “Yes”, “Checked”) or is left blank when not selected.
AcroFormImport
<Owner>On</Owner>
<Corporation>Off</Corporation>
<LLC>Off</LLC>
<SoleProp>On</SoleProp>
<Partnership>Off</Partnership>
<Owner>On</Owner>
<Partner>Off</Partner>
<Member>Off</Member>
SampleForm
<subscribe_news>Yes</subscribe_news>
→ Checkbox (checked)<subscribe_updates>Yes</subscribe_updates>
→ Checkbox (checked)<subscribe_announcements>Off</subscribe_announcements>
→ Checkbox (unchecked)
Other form examples:

In this example, the data file field looks like:
<c1_1>2</c1_1>
Where 2
is considered "No" and 1
is considered "Yes".
4. Radio Button Group
- Only one option selected at a time; value is the option name.
SampleForm
<gender>female</gender>
→ Radio button selection (options: male/female)
5. Drop-down (Combo Box)
- Stores the selected option’s text or export value.
SampleForm
<state>TX</state>
→ Drop-down selection (U.S. state list)
6. List Box
- Can allow multiple selections (each listed separately).
SampleForm
<fruit>Banana</fruit>
→ List box selection (Favorite fruit)
7. Signature Field
- Stores a digital signature dictionary (complex object), but in some other file formats like XFDF you may just see the placeholder.
SampleForm
<signature>Signature</signature>
→ Signature field (placeholder text, or e-signature input)
8. Buttons (Submit, Reset, Print)
- These don’t store values, so in XML they typically don’t appear, or just appear as field definitions without
<value>
.
<field name="SubmitButton"/>
These XML snippets were pulled from the sample files by using the pdfRest Export Form Data API tool. For your own data files, once you've filled in the appropriate fields, you can test importing form data into your form with the pdfRest Import Form Data API tool.
Beyond the Tutorial
In this tutorial, we discussed common PDF form input fields and how to fill them out in an XML file. This is key for understanding the output from the pdfRest Export Form Data API tool, and how to use data files to use the pdfRest Import Form Data API tool properly.
Refer to our code sample GitHub repository for examples on how to use the Import Form Data and Export Form Data API tools.
We encourage you to demo all of the pdfRest API Tools in the API Lab at https://pdfrest.com/apilab/ and refer to the API Reference documentation at https://pdfrest.com/documentation/.