Link Search Menu Expand Document

PDF Create Fillable PDF Forms

Explore Samples

Create new PDF forms with fillable edit boxes, checkboxes and other fillable fields.

To fill pdf forms or to add text, links, images please check pdf/edit/add endpoint instead.

Available Methods

[POST] /pdf/edit/add (create pdf fields)

You can create a fillable PDF form from the existing PDF by adding editable text boxes and checkboxes.

adds text, images, text fields, unchecked checkbox, and checked checkbox to existing PDF files. You can fill out existing PDF forms and documents and create new fillable PDF forms using this method.

Attributes
url required
URL to the source file. Supports links from Google Drive, Dropbox, and PDF.co built-in files storage. To upload files via API, Check out the Files Upload section.

Note: If you experience intermittent Too Many Requests or Access Denied errors, please try to add cache: to enable built-in URL caching. (e.g cache:https://example.com/file1.pdf)

For data security, you have the option to encrypt output files and decrypt input files. Learn more about user-controlled data encryption.
httpusername optional
HTTP auth user name if required to access source url.
httppassword optional
HTTP auth password if required to access source url.
annotations[] optional
The array of text objects to be added on top of pdf. Text objects can be ready-only ("type": "text" by default), input pdf input fields ("type": "textField"), or checkboxes ("type": "checkbox").

Sample:

"annotations":
[
        {
            "text": "Testing Clickable Links \r\n(CLICK ME!)",
            "x": 200,
            "y": 200,
            "size": 24,
            "pages": "0-",
            "color": "CCBBAA",
            "link": "https://bytescout.com/"
        },
        {
            "text": "Testing Clickable Links \r\n(CLICK ME!)",
            "x": 200,
            "y": 200,
            "size": 24,
            "pages": "0-",
            "color": "CCBBAA",
            "link": "https://bytescout.com/",
            "fontName": "Colibri",
            "fontItalic": true,
            "fontBold": true,
            "fontStrikeout": false,
            "fontUnderline": true,
            "type": "text"
        },
        {
            "text": "sample pdf input field with prefilled text",
            "x": 10,
            "y": 30,
            "size": 12,
            "pages": "0-",
            "type": "TextField",
            "id": "textfield1"
        },
        {
            "x": 100,
            "y": 150,
            "size": 12,
            "pages": "0-",
            "type": "Checkbox",
            "id": "checkbox2"
        }
]

Check the font list for all supported fonts.

Attributes
images[] optional
The Array of image objects to be added on top of the PDF file. Images can be loaded from URLs or from URLs for internal file storage.

Sample:

"images": [
        {
            "url": "pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-edit/logo.png",
            "x": 200,
            "y": 250,
            "pages": "0",
            "link": "www.pdf.co"
        }    
]
Attributes
fields[] optional
The Array of values to update fillable pdf fields in input pdf. You can create your own automated PDF filler for your pdf forms using this array.

Sample:

"fields: 
[
        {
            "fieldName": "topmostSubform[0].Page1[0].FilingStatus[0].c1_01[1]",
            "pages": "1",
            "text": "True"
        },
        {
            "fieldName": "topmostSubform[0].Page1[0].FilingStatus[0].c1_01[1]",
            "pages": "1",
            "text": "True"
        }
]        
Attributes
password optional
Password of PDF file, The input must be in string format.
async optional
Set async to true for long processes to run in the background, API will then return a jobId which you can use with /job/check endpoint to check the status of the process and retrieve the output while you can proceed with other tasks without waiting for this process to finish.
IMPORTANT: Also set the inline param to true to get a direct link to the final output pdf in both sync and async modes. Otherwise, you will be getting a direct link to pdf in sync mode but also a link to the .json file in the async mode.
inline optional
Set to true to get a direct link to output pdf in async mode (otherwise you will get a link to JSON with URL inside when you use async mode).
name optional
The file name for the generated output, The input must be in string format.
expiration optional
Set the expiration time for the output link in minutes (default is 60 i.e 60 minutes or 1 hour), After this specified duration, any generated output file(s) will be automatically deleted from PDF.co temporary files storage. The maximum duration for link expiration varies based on your current subscription plan. Learn more

To store permanent input files (e.g. re-usable images, pdf templates, documents), Consider using PDF.co built-in Files Storage.
profiles optional
Use this parameter to set additional configurations for fine-tuning and extra options. Explore PDF.co knowledgebase for profile examples, The input must be in string format.
  • Method: POST
  • URL: /v1/pdf/edit/add

Query parameters

No query parameters accepted.

Body payload

{
    "async": false,
        "inline": true,
    "name": "newDocument",
    "url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-edit/sample.pdf",
    "annotations":[        
       {
            "text":"sample prefilled text",
            "x": 10,
            "y": 30,
            "size": 12,
            "pages": "0-",
            "type": "TextField",
            "id": "textfield1"
        },
        {
            "x": 100,
            "y": 150,
            "size": 12,
            "pages": "0-",
            "type": "Checkbox",
            "id": "checkbox2"
        },
        {
            "x": 100,
            "y": 170,
            "size": 12,
            "pages": "0-",
            "link": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-edit/logo.png",
            "type": "CheckboxChecked",
            "id":"checkbox3"
        }          
        
    ],
    "images": [
        {
            "url": "pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-edit/logo.png",
            "x": 200,
            "y": 250,
            "pages": "0",
            "link": "www.pdf.co"
        }
        
    ]
}

Example responses

POST /pdf/edit/add
{
    "url": "https://pdf-temp-files.s3-us-west-2.amazonaws.com/d5c6efa549194ffaacb2eedd318e0320/newDocument.pdf?X-Amz-Expires=3600&x-amz-security-token=FwoGZXIvYXdzECMaDJJV7qKrpnGUrZHrwSKBATR5rxVlQoU0zj3r4jyHPt7yj4HoCIBi65IbMRWVX8qZZtKL9YGUzP%2FcemlqVd4Vi5%2B80Sg%2BymqQtaQ8qSFqKA82JnV%2BNBDatIigZIZha%2BrQM3jSC%2FZhX1zxsfLLsaH3K5nBnkjT3gi%2FZnx%2FgqrlIhf3m2xRFaTlgHrBADlK9KKPIijSusD4BTIo%2FQ433xx%2FQEaGWdX0nu4NuiByyXNPsBCAI3im9LMUCujjqF79ocyLHA%3D%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIA4NRRSZPHCSWKUQ4T/20200716/us-west-2/s3/aws4_request&X-Amz-Date=20200716T092641Z&X-Amz-SignedHeaders=host;x-amz-security-token&X-Amz-Signature=2aa88d39aaf4b5891e4cb42d5675a64486098558d7159b37b75252209bdd6a95",
    "pageCount": 1,
    "error": false,
    "status": 200,
    "name": "newDocument",
    "remainingCredits": 77762
}

Code Snippet

CURL
curl --location --request POST 'https://api.pdf.co/v1/pdf/edit/add' \
--header 'Content-Type: application/json' \
--header 'x-api-key: ' \
--data-raw '{
    "async": false,
        "inline": true,
    "name": "newDocument",
    "url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-edit/sample.pdf",
    "annotations":[        
       {
            "text":"sample prefilled text",
            "x": 10,
            "y": 30,
            "size": 12,
            "pages": "0-",
            "type": "TextField",
            "id": "textfield1"
        },
        {
            "x": 100,
            "y": 150,
            "size": 12,
            "pages": "0-",
            "type": "Checkbox",
            "id": "checkbox2"
        },
        {
            "x": 100,
            "y": 170,
            "size": 12,
            "pages": "0-",
            "link": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-edit/logo.png",
            "type": "CheckboxChecked",
            "id":"checkbox3"
        }          
        
    ],
    "images": [
        {
            "url": "pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-edit/logo.png",
            "x": 200,
            "y": 250,
            "pages": "0",
            "link": "www.pdf.co"
        }
        
    ]
}'

Samples