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
[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 from built-in PDF.co files storage. For uploading files via API please check Files Upload section. If you are randomly getting a Too Many Requests or Access Denied error for your input URL, Please try to add cache: to enable built-in URL caching. You can also encrypt data for output files and decrypt data input files with user-controlled data encryption to learn more. |
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 Runs processing asynchronously and returns JobId that you may use with /job/check to check the state of the processing (possible states: working , failed , aborted and success ). Must be one of: true , or false .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 Output link expiration in minutes. The 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 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
- AWS Lambda - Fillable PDF Forms - Node Js
- C# - Fillable PDF Forms
- Java - Fillable PDF Forms
- JavaScript - Fillable PDF Forms
- PHP - Fillable PDF Forms
- PowerShell - Fillable PDF Forms
- Python - Fillable PDF Forms
- Salesforce - Salesforce
- VB.NET - Fillable PDF Forms
- cURL - Fillable PDF Forms
Copyright © 2016 - 2023 PDF.co