PDF Editor API Benefits

Fast and easy to use

Using PDF.co you can easily add texts, images, and signatures to your PDF. You can fill out existing PDF forms and documents and create new fillable PDF forms using this method. You can also add annotations or links using PDF.co Web API.

Web API Supports Multiple Languages

Programmers can run Web API engines at the PDF.co platform using the following programming languages: C#, PHP, Javascript, .NET and ASP.NET, Java, Visual Basic, and many others.

Business Automation Platforms Integrations

If you are not a developer, you can also easily automate your PDF operations via popular business automation platforms: ZapierMakeAirtableSalesforceGoogle Apps Script, and 300+ more.

If you need to get specific coordinates in PDF, you can use this simplified PDF Viewer tool. It is available in PDF.co Web API and its integrations.

SIGN UP FOR FREE

PDF Editor API Sample & Demo

For this demo, I am going to use a Sample PDF File.

Screenshot of Source File
Screenshot of Source File

The code snippets used below can be written in different programming languages. The Web API engine adds text to our sample PDF file. The final result will look like this.

Screenshot of Output PDF
Screenshot of Output PDF

Before we proceed with the code. Let us first check the /v1/pdf/edit/add parameters and its uses.

Endpoint

URL: https://api.pdf.co/v1/pdf/edit/add
Method: POST
Parameter Description
url required. Link to the source file.
annotations[] optional. An 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"). See font list for all PDF.co supported fonts.
images[] optional. An array of image URLs (also can be a link to Files storage or Datauri link) to be added on top of the PDF file. Images can be loaded from URLs or URLs for internal file storage.
fields[] optional. An 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.
password optional. The password of the PDF file. Must be a String.
async optional. Runs processing asynchronously. Returns Use JobId that you may use with /job/check to check the state of the processing (possible states: workingfailedaborted and success). Must be one of: truefalse.
encrypt optional. Enable encryption for the output file: true or false
name optional. Output file name.
profiles optional. Must be a String. Set custom configuration. See profiles examples here

Now we are ready to write some codes.

cURL Code Snippet

curl --location --request POST 'https://api.pdf.co/v1/pdf/edit/add' \
--header 'Content-Type: application/json' \
--header 'x-api-key: YOUR_API_KEY' \
--data-raw '{
"async": false,
"encrypt": 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 Text 1",
"x": 35,
"y": 253,
"size": 20,
"pages": "0-"
}
] 
}'

This sample code and other cURL source code samples are available here.

 

Now let’s see this program in action.

Output using cURL
Output using cURL

The source code samples in JavaScript are available here.

The source code samples in Java are available here.

The source code samples in PHP are available here.

The source code samples in C# are available here.

The source code samples in Python are available here.

SIGN UP FOR FREE