Add Form Fields to PDF
Forms → Add Form Fields to PDF
The Add Form Fields to PDF API adds form fields (text boxes or checkboxes) to a PDF at specific positions. You send the PDF as Base64 (docContent), docName, formFieldType (TextBox or CheckBox), fieldName, initialValue, positionX and positionY, Size, pages, and optionally async. The API returns the PDF with the new form fields added. Use the tester below to try it; more details are in the sections that follow.
Try the Add Form Fields to PDF API
:::note Quick reference
Endpoint: POST /api/v2/AddFormField · Required: api-key, docContent, docName, initialValue, positionX, positionY, fieldName, Size, pages, formFieldType
:::
:::info Try it live Use the form below to send your API key, PDF (Base64), field type (TextBox or CheckBox), name, position, size, and pages. The response is the PDF with the new form field(s). No code required—fill the fields and click Send request. :::
Overview, parameters, and use cases
- Overview
- Parameters
- Use cases
What is Add Form Fields to PDF?
This endpoint adds one or more form fields to a PDF at specific positions. You choose formFieldType (TextBox or CheckBox), set fieldName, initialValue, positionX and positionY (coordinates on the page), Size, and pages (e.g. 1, 1-3, 1,3,5, 1-). The API returns the PDF with the new fillable fields. Use it to turn a static PDF into a form or add extra fields to an existing form.
Key features
- Field types – formFieldType: TextBox or CheckBox.
- Position and size – positionX, positionY (coordinates); Size (field size).
- Field identity – fieldName (unique name for the field), initialValue (default value).
- Page targeting – pages: 1, 1-3, 1,3,5, 1- (from page 1 to end).
- Async – Use async for PDFs with many fields.
:::tip Best for Use when you need to add fillable text boxes or checkboxes to a PDF. Pair with Fill PDF Form to populate the fields, or Extract Form Data from PDF to read submitted values. :::
API parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| api-key | string | Yes | Your PDF4me API key, Base64 encoded. Get it from the dashboard. |
| docContent | base64 | Yes | PDF file content (Base64). |
| docName | string | Yes | PDF file name with .pdf extension. |
| initialValue | string | Yes | Initial/default value for the form field. |
| positionX, positionY | integer | Yes | X and Y position of the field on the page. |
| fieldName | string | Yes | Name of the form field (unique identifier). |
| Size | integer | Yes | Size of the form field. |
| pages | string | Yes | Page(s): 1, 1-3, 1,3,5, 1,3,7-10, 1-. |
| formFieldType | string | Yes | TextBox or CheckBox. |
| async | boolean | No | Enable asynchronous processing. |
When to use Add Form Fields to PDF
- Form creation – Add text boxes and checkboxes to a PDF to make it fillable.
- Templates – Add named fields to a template so they can be filled via Fill PDF Form or your app.
- Extending forms – Add extra fields to an existing PDF form (e.g. signature date, approval checkbox).
:::info Need the full API? For request/response schemas and code samples, see Add Form Fields to PDF in the PDF4me API docs. :::
Prerequisites
Before using this endpoint, make sure you have:
- A valid PDF4me API key (Get your API Key)
- A PDF document in Base64 format or a public URL to a PDF file
Response Format
The API returns a PDF document with the form fields added at the specified positions.