Link Search Menu Expand Document

PDF Create Fillable PDF Forms

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

Go To Samples

[POST] /pdf/edit/add

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

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

  • url required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section. If you are randomly getting Too Many Requests or Access Denied error for your input url, please try to add cache: to enable built-in url caching.
  • httpusername (optinal) - http auth user name if required to access source url.
  • httppassword (optinal) - http auth password if required to access source url.

  • annotations[]. optional. 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.

  • images[] optional. Array of image objects to be added on top of PDF file. Images can be loaded from URL or from URLs for internal file storage. Sample:
    "images": [
          {
              "url": "bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png",
              "x": 200,
              "y": 250,
              "pages": "0",
              "link": "www.pdf.co"
          }    
    ]
    
  • fields[] optional. Array of values to update filable 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"
          }
    ]        
    
  • password optional. Password of PDF file. Must be a String.

  • async optional. Runs processing asynchronously. Returns Use JobId that you may use with /job/check to check state of the processing (possible states: working, failed, aborted and success). Must be one of: true, false. IMPORTANT: Also set inline param to true to get direct link to final output pdf in both sync and async modes. Otherwise, you will be getting direct link to pdf in sync mode but also link to .json file in the async mode.

  • inline optional. Set to true to get direct link to output pdf in async mode (otherwise you will get link to json with url inside when you use async mode).

  • encrypt optional. Enable encryption for output file. Must be one of: true, false.

  • name optional. File name for generated output. Must be a String.
  • expiration (optional). Output link expiration in minutes. Default is 60 (i.e. 60 minutes or 1 hour). After this delay generated output file(s) (if any) will be auto-removed from PDF.co temporary files storage. Max allowed expiration period depends on your current subscription plan. To store permanent input files (e.g. re-usable images, pdf, documents), please use PDF.co built-in Files Storage instead.

  • profiles optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.

Description

  • Method: POST
  • URL: /v1/pdf/edit/add

Query parameters

No query parameters accepted.

Body payload

{
    "async": false,
    "encrypt": true,
    "inline": true,
    "name": "newDocument",
    "url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/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://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png",
            "type": "CheckboxChecked",
            "id":"checkbox3"
        }          
        
    ],
    
    "images": [
        {
            "url": "bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/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,
    "encrypt": true,
    "inline": true,
    "name": "newDocument",
    "url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/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://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png",
            "type": "CheckboxChecked",
            "id":"checkbox3"
        }          
        
    ],
    
    "images": [
        {
            "url": "bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png",
            "x": 200,
            "y": 250,
            "pages": "0",
            "link": "www.pdf.co"
        }
        
    ]
}'

Samples