Interactive PDF Forms (AcroForms)
Last updated March 23, 2026
PDFMonkey can generate interactive PDF forms (AcroForms) by detecting special markers in your template and converting them into fillable form fields. The generated PDFs can be filled out directly in PDF readers like Adobe Acrobat or Preview.
Enabling PDF Forms
To enable PDF forms in your template:
- Go to your template\u2019s Settings tab
- Enable the PDF Forms option
- Add form field markers to your template content
When using the API, set use_forms: true in your template\u2019s settings or settings_draft object.
Marker Syntax
Markers follow a specific syntax that tells PDFMonkey what type of field to create and how to configure it:
[% data_form_field_TYPE_NAME_OPTIONS %]
Required elements
[%and%]\u2014 start and end delimitersdata_form_field\u2014 required prefix for detectionTYPE\u2014 field type (text, checkbox, dropdown, etc.)
Optional elements
NAME\u2014 custom field name (e.g.,firstname,email)OPTIONS\u2014 dimensions, validation, alignment, etc.
Basic examples
[% data_form_field_text_w200_h30 %]
[% data_form_field_checkbox_w20_h20 %]
[% data_form_field_dropdown_w250_h30_options[Option1,Option2,Option3] %]
Field Types
Text fields
Single-line text
[% data_form_field_text_w300_h30 %]
[% data_form_field_text_firstname_w250_h30_required %]
Use for: names, addresses, phone numbers, short text.
Multi-line text (textarea)
[% data_form_field_textarea_w400_h100 %]
[% data_form_field_textarea_comments_w500_h150_max500 %]
Use for: comments, descriptions, long messages.
Password field
[% data_form_field_text_password_w250_h30_password %]
Email field (with validation)
[% data_form_field_text_email_w350_h30_email %]
[% data_form_field_text_contact_w400_h30_required_email %]
Phone field
[% data_form_field_text_phone_w200_h30_phone %]
Selection fields
Checkbox
[% data_form_field_checkbox_w20_h20 %]
[% data_form_field_checkbox_accept_terms_w20_h20_required %]
Example in a template:
<p>\u2610 I accept the terms [% data_form_field_checkbox_accept_w20_h20 %]</p>
<p>\u2610 Subscribe to newsletter [% data_form_field_checkbox_newsletter_w20_h20 %]</p>
Dropdown (select)
[% data_form_field_dropdown_w250_h30_options[Option1,Option2,Option3] %]
[% data_form_field_dropdown_country_w300_h30_options[France,Belgium,Switzerland,Canada] %]
options[A,B,C]. A dropdown without options will not be created.Radio buttons
[% data_form_field_radio_w20_h20_options[Male,Female,Other] %]
[% data_form_field_radio_payment_w20_h20_options[Card,Transfer,Cash] %]
Radio buttons with the same name form a group \u2014 only one option can be selected at a time.
Specialized fields
Number field
[% data_form_field_number_w100_h30 %]
[% data_form_field_number_age_w80_h30_min18_max120 %]
[% data_form_field_number_quantity_w60_h30_min1_max99 %]
Date field
[% data_form_field_date_w150_h30_format_dd_mm_yyyy %]
[% data_form_field_date_birthdate_w150_h30_format_dd_mm_yyyy_required %]
Available formats:
format_dd_mm_yyyy\u2014 DD/MM/YYYY (European)format_mm_dd_yyyy\u2014 MM/DD/YYYY (US)format_yyyy_mm_dd\u2014 YYYY-MM-DD (ISO)
Comb field (for codes)
[% data_form_field_text_zipcode_w150_h30_max5_comb %]
[% data_form_field_text_serial_w200_h30_max10_comb %]
Use for: postal codes, serial numbers, verification codes. Each character has its own visual box.
Borderless fields
[% data_form_field_text_w300_h30_noborder %]
[% data_form_field_text_user_id_w200_h30_invisible_readonly %]
Use for elegant forms without black rectangles, invisible metadata fields, or pre-filled values. The noborder option sets the border to 0 and the background to transparent while keeping the field fully functional.
Dotted guide line technique: combine white marker text, noborder, and manually drawn dotted lines underneath:
<p style="color: white;">[% data_form_field_text_email_w350_h30_noborder_email %]</p>
<p style="border-bottom: 1px dotted #999; width: 350px;"></p>
The white marker is invisible in the PDF, the dotted lines guide the user, and the generated field is transparent and functional.
Field Options
Dimensions
Required for proper rendering:
| Option | Description |
|---|---|
w{width} | Width in pixels |
h{height} | Height in pixels |
Recommended sizes:
| Field type | Width | Height |
|---|---|---|
| Short name | 150\u2013250 px | 30 px |
| 300\u2013400 px | 30 px | |
| Address | 400\u2013500 px | 30 px |
| Textarea | 400\u2013600 px | 80\u2013150 px |
| Checkbox | 20 px | 20 px |
| Dropdown | 200\u2013300 px | 30 px |
| Date | 120\u2013150 px | 30 px |
| Number | 60\u2013100 px | 30 px |
Field state
| Option | Description |
|---|---|
required | Required field |
mandatory | Alias for required |
readonly | Read-only (not editable) |
Constraints
| Option | Description |
|---|---|
max{number} | Maximum length (text) or maximum value (number) |
min{number} | Minimum value (number only) |
Alignment and style
| Option | Description |
|---|---|
left | Left-aligned text (default) |
center | Centered text |
right | Right-aligned text |
font{size} | Font size (10, 12, 14, etc.) |
Default values
Pre-fill a field using default_{value}. Replace spaces with underscores:
[% data_form_field_text_country_w200_h30_default_France %]
[% data_form_field_text_w300_h30_default_Enter_your_name %]
Custom field names
The first unrecognized element in the marker becomes the field name:
[% data_form_field_text_firstname_w200_h30 %]
Here firstname is the field name. Use descriptive snake_case names (user_email rather than email1) to make data processing easier.
Complete Examples
Contact form
<h1>Contact Form</h1>
<p>Last name: [% data_form_field_text_lastname_w300_h30_required %]</p>
<p>First name: [% data_form_field_text_firstname_w300_h30_required %]</p>
<p>Email: [% data_form_field_text_email_w350_h30_required_email %]</p>
<p>Phone: [% data_form_field_text_phone_w200_h30_phone %]</p>
<p>Message:</p>
<p>[% data_form_field_textarea_message_w500_h120_required_max1000 %]</p>
<p>\u2610 I agree to be contacted [% data_form_field_checkbox_accept_w20_h20 %]</p>
Registration form
<h1>Registration Form</h1>
<h2>Personal Information</h2>
<p>Title: [% data_form_field_dropdown_civility_w100_h30_options[Mr,Mrs,Ms] %]</p>
<p>Last name: [% data_form_field_text_lastname_w250_h30_required %]</p>
<p>First name: [% data_form_field_text_firstname_w250_h30_required %]</p>
<p>Birth date: [% data_form_field_date_birthdate_w150_h30_format_dd_mm_yyyy %]</p>
<p>Age: [% data_form_field_number_age_w80_h30_min18_max120 %]</p>
<h2>Contact</h2>
<p>Email: [% data_form_field_text_email_w350_h30_required_email %]</p>
<p>Phone: [% data_form_field_text_phone_w200_h30_phone %]</p>
<h2>Address</h2>
<p>Street: [% data_form_field_text_address_w450_h30_required %]</p>
<p>Postal code: [% data_form_field_text_zipcode_w120_h30_max5_comb %]</p>
<p>City: [% data_form_field_text_city_w250_h30_required %]</p>
<p>Country: [% data_form_field_dropdown_country_w250_h30_options[France,Belgium,Switzerland,Canada] %]</p>
<h2>Terms</h2>
<p>\u2610 I accept the terms [% data_form_field_checkbox_accept_terms_w20_h20_required %]</p>
<p>\u2610 Subscribe to newsletter [% data_form_field_checkbox_newsletter_w20_h20 %]</p>
Troubleshooting
Marker not detected
The marker remains visible in the final PDF. Check:
- The prefix is exactly
data_form_field(notform_fieldordata_field) - The delimiters are
[%and%](not{%%}or other brackets) - There are no line breaks inside the marker
Field mispositioned
Adjust the w and h dimensions and make sure there is enough space in the template around the marker.
Dropdown or radio without options
Dropdowns and radio buttons require the options[...] parameter. Without it, the field is not created.
[% data_form_field_dropdown_country_w250_h30_options[France,Belgium,Switzerland] %]
Best Practices
- Start simple \u2014 test with 2\u20133 fields before building a complete form
- Name your fields \u2014 use descriptive names for easier data processing
- Test in preview \u2014 always preview your template before generating documents
- Use default values \u2014 pre-fill common fields to reduce input effort
- Hide markers visually \u2014 set the marker text color to match the background so it doesn\u2019t show through the form field:
<span style="color: white;">[% data_form_field_text_name_w300_h30 %]</span> - Combine border styles \u2014 use classic borders for required fields and
noborderfor secondary fields to create visual hierarchy
Limitations
- Signature fields are not currently supported as interactive form fields
- Complex field validation beyond basic types (email, phone) is limited
- Fields work best with PDF Engine v5
Related pages
- Page Layout \u2014 control page sizing and margins
- Custom CSS \u2014 style your forms
- API Templates reference \u2014 API documentation for template settings
Frequently asked questions
- Can PDFMonkey generate fillable PDF forms?
- Yes. Enable the PDF Forms option in your template settings, then add marker syntax in your HTML. PDFMonkey detects the markers and converts them into interactive AcroForm fields in the generated PDF.
- What types of form fields does PDFMonkey support?
- PDFMonkey supports text fields, multi-line text areas, checkboxes, dropdowns, radio buttons, number fields, date fields, and comb fields. Each field type accepts options for dimensions, validation, alignment, and default values.
- Do PDF form fields work with the API?
- Yes. Enable forms via the API by setting use_forms: true in your template settings. The marker syntax in the template HTML is processed during generation, producing interactive fields in the output PDF.