API V2

Add Form Fields To PDF

  • Method: POST
  • Endpoint: /api/v2/AddFormField

Parameters

Parameters for adding form fields to PDF documents.

docNameString, Required

Source PDF file name with .pdf extension

docContentBase64, Required

The content of the input file

Initial ValueString, Required

You can take any input but it must be string.
Example - input text.

PositionXinteger, Required
Default: 0

The default value is 0. If the horizontal alignment is Left, it will give a gap from the left edge of the page. If Right, it will give a gap from the right edge of the page. If Center, this field is ignored.
Example - 300

PositionYinteger, Required
Default: 0

The default value is 0. If the vertical alignment is Top, it will give a gap from the top edge of the page. If Bottom, it will give a gap from the bottom edge of the page. If Middle, this field is ignored.
Example - 300

Field NameString, Required

Input filed name, it must be string.
Example - Input field name

Sizeinteger, Required
Default: 0

The default value is 0. you can select size based on our requirement.
Example - 4

PagesString, Required
  • Specify page indices as comma-separated values or ranges to process (e.g. “0, 1, 2-” or “1, 2, 3-7”).
  • If not specified, the default configuration processes all pages. The input must be in string format.
Form Field TypeString, Required
Default: TextBox

You can select any one form field type -

  • TextBox
  • CheckBox

Output

Output parameters for the PDF document with form fields.

File ContentBinary

File content of the compressed document

File NameString

The file name of the output document

Header
Content-Type:application/json
Authorization: Please copy key from the link.

Payload

{
  "docContent": "Please put PDF base64 content",
  "docName": "output.pdf",
  "initialValue": "input text",
  "positionX": 300,
  "positionY": 300,
  "fieldName": "Input Field Name",
  "Size": 4,
  "pages": "1",
  "formFieldType": "TextBox"
}

PDF4me api samples

CSharp(C#)
Java
JavaScript
Python
Salesforce
n8n
Google Script
AWS Lambda