PDF Forms

PDFMonkey can generate interactive PDF forms (AcroForms) by detecting special markers in your template and converting them into fillable form fields.

Overview

When you enable the PDF forms feature in your template settings, PDFMonkey automatically detects markers in your HTML content and replaces them with interactive form fields in the generated PDF. This allows you to create forms that 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 settings

  2. Enable the "PDF Forms" option (similar to enabling JavaScript or Emojis)

  3. Add form field markers to your template content

When enabled via the API, set use_forms: true in your template's 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 %] - Start and end delimiters

  • data_form_field - Required prefix for detection

  • TYPE - Field type (text, checkbox, dropdown, etc.)

Optional Elements

  • NAME - Custom field name (e.g., firstname, email)

  • OPTIONS - Dimensions, validation, alignment, etc.

Basic Examples

Field Types

Text Fields

Single-line Text

Use for: Names, addresses, phone numbers, short text

Multi-line Text (Textarea)

Use for: Comments, descriptions, long messages

Password Field

Use for: Passwords, PINs, sensitive information

Email Field (with validation)

Use for: Email addresses

Phone Field

Use for: Phone numbers

Selection Fields

Checkbox

Use for: Terms acceptance, yes/no options, multiple selections

Example in template:

Use for: Country lists, department selection, multiple choice (single selection)

Important: You must specify all options in the marker using options[A,B,C]

Radio Buttons

Use for: Exclusive choices (gender selection), single option among several

Note: Radio buttons with the same name form a group

Specialized Fields

Number Field

Use for: Age, quantities, amounts, scores

Date Field

Available formats:

  • format_dd_mm_yyyy - DD/MM/YYYY (European)

  • format_mm_dd_yyyy - MM/DD/YYYY (USA)

  • format_yyyy_mm_dd - YYYY-MM-DD (ISO)

Comb Field (for codes)

Use for: Postal codes, serial numbers, verification codes

Appearance: Each character has its own visual box

Borderless Fields (noborder / invisible)

Use for:

  • Elegant forms: Fields without black rectangles, with manually drawn dotted guide lines

  • Invisible metadata: Tracking, references, user IDs

  • Pre-filled values: Invisible but editable default values

  • Clean design: Alternative to classic borders

Features:

  • ✅ Border: 0 (invisible)

  • ✅ Background: Transparent (shows content underneath)

  • ✅ Functional: Captures text normally

  • ✅ Compatible: All field types (text, checkbox, dropdown, etc.)

Advanced technique - Dotted guide lines:

To create elegant writing lines, combine:

  1. Marker in WHITE on white background (invisible to the eye)

  2. Manually drawn dotted lines at the base of the field

  3. noborder option to make the field transparent

Example in your design software:

Result:

  • White marker is invisible in the PDF

  • Dotted lines guide the user

  • Generated field is transparent and functional

Complete examples:

Field Options

Dimensions

Required for proper rendering:

Examples:

Size Guide:

Type
Recommended Width
Recommended Height

Short name

150-250px

30px

Email

300-400px

30px

Address

400-500px

30px

Textarea

400-600px

80-150px

Checkbox

20px

20px

Dropdown

200-300px

30px

Date

120-150px

30px

Number

60-100px

30px

Field State

Examples:

Constraints

Examples:

Alignment and Style

Examples:

Default Values

Examples:

Custom Field Names

The first unrecognized element becomes the field name:

Benefits:

  • Clearly identifies the field

  • Facilitates data processing

  • Improves readability

Naming conventions:

  • Use snake_case: first_name, email_address

  • Be descriptive: user_email rather than email1

  • Avoid special characters

Complete Examples

Simple Contact Form

Registration Form

Elegant Form with Borderless Fields

Technique to create this template:

  1. In Word/InDesign/Canva:

    • Write the markers at field locations

    • Set marker text color to WHITE (invisible)

    • Manually draw dotted lines under the fields

    • Dotted lines remain visible, markers disappear

  2. Result after processing:

    • Transparent AcroForms fields (noborder option)

    • Visible dotted lines to guide the user

    • Clean design without black rectangles

    • Functional in all PDF readers

Common Errors and Solutions

Marker Not Detected

Problem: The marker remains visible in the final PDF

Solutions:

  1. Check the prefix data_form_field

  2. Check the delimiters [% and %]

  3. No line breaks within the marker

Field Mispositioned

Problem: The field overflows or is offset

Solutions:

  1. Adjust the w and h dimensions

  2. Ensure there's enough space in the template

  3. Align the marker properly in your design

Problem: The field is not created

Solution: Add options[...]

Best Practices

  1. Start simple: Test with 2-3 fields before creating a complete template

  2. Name your fields: Use descriptive names for easier data processing

  3. Test in preview: Always preview your template before generating documents

  4. Use default values: Pre-fill common fields to facilitate input

  5. Align for readability: Align your fields for a professional appearance

  6. Provide adequate spacing: Ensure markers have enough space around them

  7. Document your fields: Keep a list of used fields and their purpose

  8. Hide markers visually: To prevent markers from being visible under the form fields in the generated PDF, set the marker text color to match your background color (e.g., white text on white background). The form field will render on top, but any visible marker text won't show through.

  9. Create elegant forms with borderless fields: Combine noborder option + white marker text + manually drawn dotted lines for a professional, clean design without visible form rectangles.

  10. Mix border styles strategically: Use classic borders for important required fields and borderless fields for secondary or optional information 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

See Also

Last updated

Was this helpful?