This tutorial will guide you through the process of finding and replacing text in PDFs using PDF.co and Make. Here are the steps:

  1. Sample PDF File
  2. Make an API Call
  3. Add API Endpoint
  4. Add File URL
  5. Add Search and Replace Text
  6. Set Params And Values
  7. Check PDF.co URL Result
  8. Search And Replace Text Output

Step 1: Sample PDF File

For teaching purposes, we will use the PDF document below and replace its Company Name. By following the step-by-step process, you will learn how to search and replace specific text in a PDF using PDF.co and Make.

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

With the sample PDF document in place, we will begin by creating a scenario. We will select PDF.co as our app then we will choose the Make an API Call module. This will enable us to call any PDF.co Web API endpoints.

Create New Scenario

Step 3: Add API Endpoint

In the API Endpoint Path field, we will add the Search and Replace API endpoint v1/pdf/edit/replace-text. To learn more about the API endpoint, click here.

Insert Replace Text API Endpoint

Step 4: Add File URL

At this point, we will select Set Input URL Param Directly as our Input Type to enter our source file link. Then we will input our URL file in the URL field. Enter The Source URL

Step 5: Add Search and Replace Text

Now, it’s time to add search and replace text. We will click on Add Item under the Body, then we will input the searchString parameter and its corresponding value.

Add Search And Replace Text

Step 6: Params And Values

After entering all the items needed for searchString and replaceString parameters, we are ready to Run the scenario to obtain a result.

Items Added In The Body

Step 7: PDF.co URL Result

PDF.co has now processed our request and generated a URL so we can see the result. However, to maintain system security the URL is just temporary and will automatically expire after one hour. To store the file permanently, we strongly recommend that you add another module.

PDF.co Generated URL

Step 8: Search And Replace Text Output

As you can see now in the final output, we successfully replaced the original Your Company Name with XYZ LLC in this PDF Invoice.

 

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

 

Congratulations! You just 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 observed, and perhaps followed the entire process of finding and replacing text in PDF files using PDF.co and Make.

Related Samples: