New: PDF/A-3b conversion with a compliance report included.See Docs

How to Edit a Scanned PDF File using PDF.co and Postman

This tutorial adds a logo, a signature image, a clickable link and a note on top of a scanned PDF using PDF.co and Postman. It does not rewrite text within the scanned image. The original scan remains the background of the output PDF.

Step 1: Sample Scanned PDF

Sample Scanned PDF Invoice
Sample Scanned PDF Invoice

Step 2: Open Postman Collection

We assume that you already set up the PDF.co Postman collection. If you haven’t yet, you can check out this step-by-step guide.

Open the PDF.co API v.1.00 collection and click on /pdf/edit/add under the PDF Add Text, Signature and Images to PDF folder. This will open a tab of a template with ready-to-run JSON.

Open The PDF/Edit/Add Endpoint In The Postman Collection

Step 3: Fill Parameter Values

The pdf/edit/add endpoint parameters are already provided for and you can edit the values with your own. Let’s change the name to result, add the scanned PDF file URL, add the text objects in the annotations[] parameter, and the company logo and signature in the images[] parameter. Once all the values are added, click on the Send button so PDF.co can process the request.

Add Name, URL, And Annotations Parameters Values
Add Image Parameter Values


Here’s the cURL code version of the sample above:

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 '{
    "name": "result",
    "url": "YOUR_SOURCE_PDF_URL",
    "annotations": [
      {
        "text": "Please call the main office when no one answers the local number",
        "x": 37,
        "y": 260,
        "pages": "0"
      },
      {
        "text": "Sign Here",
        "x": 437,
        "y": 226,
        "pages": "0"
      },
      {
        "text": "https://pdf.co",
        "x": 38,
        "y": 109,
        "size": 12,
        "pages": "0",
        "link": "https://pdf.co",
        "fontName": "Times"
      }
    ],
    "images": [
      {
        "url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-edit/logo.png",
        "x": 431,
        "y": 32,
        "pages": "0"
      },
      {
        "url": "YOUR_SIGNATURE_IMAGE_URL",
        "x": 400,
        "y": 120,
        "width": 180,
        "height": 180,
        "pages": "0"
      }
    ]
  }'

Replace YOUR_SOURCE_PDF_URL and YOUR_SIGNATURE_IMAGE_URL with file URLs that PDF.co can access. If you use PDF.co file storage, supply the filetoken:// references from your own account. The example author’s file tokens do not grant access to their files.

Keep the example’s annotation and image settings initially, then adjust their positions for your document. Use the PDF Inspector to determine placement coordinates.

Adding a signature image places a visible image on the page. It does not create a certificate-based digital signature.

PDF.co has built-in file storage where you can upload files and store files permanently. The files are private and secure. Only you will be allowed to use the private URL to access the file.

You can use the Make a Signature tool to draw your signature. The signature can be downloaded in PNG or you can use the Datauri as an image URL.

The Simple PDF Viewer is a very handy tool to get an object’s coordinate in a document. You can easily set and get the text and the coordinates of the image.

Step 4: PDF.co Call Result

Great! PDF.co successfully processed the call. Kindly copy and paste the URL in your browser to see the result. The URL is temporary and will expire after an hour by default. You have the option to increase the output link expiration in the Business plan and higher.

PDF.co Generated Output URL

Step 5: Scanned PDF Output

After we have added the company logo, affixed our signature, added a clickable company link and a note, our scanned PDF now looks like this. The document can be downloaded to your computer and/or printed right there.

Edited Scanned PDF Output
Edited Scanned PDF Output

Check the response for an error before opening the returned output URL. Inspect the resulting PDF to confirm that the logo, note and signature image appear in the intended positions, then click the website link to verify its destination.

Download or save the completed PDF while its temporary URL is valid. Check the response’s outputLinkValidTill value, when provided, and the current expiration limits for your account.

Video Guide

Related Tutorials

See Related Tutorials