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:

  1. Go to your template\u2019s Settings tab
  2. Enable the PDF Forms option
  3. 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 delimiters
  • data_form_field \u2014 required prefix for detection
  • TYPE \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>
[% data_form_field_dropdown_w250_h30_options[Option1,Option2,Option3] %]
[% data_form_field_dropdown_country_w300_h30_options[France,Belgium,Switzerland,Canada] %]
You must specify all options in the marker using 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:

OptionDescription
w{width}Width in pixels
h{height}Height in pixels

Recommended sizes:

Field typeWidthHeight
Short name150\u2013250 px30 px
Email300\u2013400 px30 px
Address400\u2013500 px30 px
Textarea400\u2013600 px80\u2013150 px
Checkbox20 px20 px
Dropdown200\u2013300 px30 px
Date120\u2013150 px30 px
Number60\u2013100 px30 px

Field state

OptionDescription
requiredRequired field
mandatoryAlias for required
readonlyRead-only (not editable)

Constraints

OptionDescription
max{number}Maximum length (text) or maximum value (number)
min{number}Minimum value (number only)

Alignment and style

OptionDescription
leftLeft-aligned text (default)
centerCentered text
rightRight-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:

  1. The prefix is exactly data_form_field (not form_field or data_field)
  2. The delimiters are [% and %] (not {% %} or other brackets)
  3. 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.

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

  1. Start simple \u2014 test with 2\u20133 fields before building a complete form
  2. Name your fields \u2014 use descriptive names for easier data processing
  3. Test in preview \u2014 always preview your template before generating documents
  4. Use default values \u2014 pre-fill common fields to reduce input effort
  5. 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>
    
  6. Combine border styles \u2014 use classic borders for required fields and noborder for 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

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.