How to Search and Replace Text in PDF using PDF.co and Make

Note

This tutorial is outdated, we recommend instead using our dedicated "Search and Replace Text" module in Make.

Let’s find out how to find and replace text in PDF files using PDF.co and Make.


Step 1: Sample PDF File

In this tutorial, we will show you how you can search and replace specific text in a PDF using PDF.co and Make. We will use this PDF document to replace its Company Name.

PDF Source File for PDF.co Search and Replace API
PDF Source File for PDF.co Search and Replace API

Step 2: Make an API Call

To get started, let’s create a new scenario and choose PDF.co as our app. Then, select the Make an API Call module. This module will allow us to call any PDF.co Web API endpoints.

Make an API Call

Step 3: Add API Endpoint

Let’s add the Search and Replace API endpoint v1/pdf/edit/replace-text in the API Endpoint Path field. You can find out more about the API endpoint in our API Documentation.

Add API Endpoint

Step 4: Add File URL

We will enter our source file link directly and so we will choose Set Input URL Param Directly as our Input Type and enter the file URL in the Url field.

Add File URL

Step 5: Add Search and Replace Text

We can now add our search and replace text. Under the Body, click on Add Item and enter the searchString parameter and its corresponding value.

Add Search and Replace Text

Step 6: Params And Values

Once you have added all the items for searchString and replaceString parameters, Run the scenario to see the result.

Params And Values

Step 7: PDF.co URL Result

Great! PDF.co processed our request and returned a URL to view the result. For security purposes, the generated URLs are temporary and are set to expire after an hour by default. We highly recommend that you add another module to store the file permanently.

PDF.co URL Result

Step 8: Search And Replace Text Output

Here’s the final look of the PDF Invoice. We have successfully replaced the original Your Company Name with XYZ LLC.

PDF.co Search and Replace Text API Output
PDF.co Search and Replace Text API Output

In this tutorial, you learned how to set up the PDF.co Make an API Call module to use any PDF.co Web API endpoints in Make. You also learned how to find and replace text in PDF files using PDF.co and Make.

Video Guide