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

Sep 9, 2024·4 Minutes Read

In this tutorial, we will demonstrate how to replace existing text in a PDF and how to replace text with an image using PDF.co and the Make platform.

Below is a sample multi-page PDF document that we will use for this demonstration.

Sample Multi-Page PDF

Step 1: Google Drive Download File

Let's begin by integrating the Google Drive module to access the file stored in the Google Drive folder.

Google Drive Download File

Step 2: Setup Google Drive

  • Select the "Choose from the list" option to enter a File ID.
  • Choose "My Drive" as the drive to be used.
  • Specify the folder and file name.
Setup Google Drive

Step 3: PDF.co Replace Text

Let's incorporate the PDF.co Search and Replace Text in PDF module to find specific text and replace it with your preferred text.

PDF.co Replace Text

Step 4: Setup PDF.co Replace Text

In this demonstration, we will replace the text as follows:

  • "Your Company Name" with "ABC Company" on the first page.
  • "ACME Inc" with "DEF Company" on the second page.
  • "Digital Ocean" with "XYZ Company" on the third page.

Now, let’s setup the PDF.co Replace Text feature:

  • Choose "Upload a File" to input the file from Google Drive.
  • Enter the text you want to replace in the "Text to Search" field.
  • Add the text you want to use for replacement in the "Text to Replace" field.
  • The Pages field allows you to specify the page numbers where the text is located. Leaving it blank will search for the text on all pages. Please note that the page index starts at 0 for the first page, 1 for the second page, and so on.
Setup PDF.co Replace Text
Setup PDF.co Replace Text 2
Setup PDF.co Replace Text 3

Step 5: Run PDF.co Replace Text

Now, let's run the scenario to process the text replacement in the PDF document. Copy the provided URL and paste it into your browser to view the output.

Run PDF.co Replace Text

Step 6: Replace Text Output

Here is the output where we have replaced the text on our desired pages.

Replace Text Output

Having completed the text replacement in the PDF document, we will now proceed to replace text with an image.

Step 7: PDF.co Replace with Image

Next, let's integrate the PDF.co Search and Replace Text with Image feature to locate specific text in the PDF document and replace it with an image.

PDF.co Replace with Image

Step 8: Setup PDF.co Replace with Image

In this demonstration, we will replace the "[[Signature]]" placeholder with an actual image of our signature and specify that the placeholder is located on pages 1,2, and 4.

Now, let’s setup the PDF.co Replace with Image feature:

  • Choose the "Import a File from URL" option to input the generated URL from PDF.co.
  • Enter the text you want to replace in the "Text to Search" field.
  • Add the image URL you want to use for the replacement in the "Text to Replace" field.
  • Specify the specific pages where you want to process the image replacement.
Setup PDF.co Replace with Image
Setup PDF.co Replace with Image 2

Step 9: Run Replace with Image

Now, let's execute the scenario to process the image replacement in the PDF document. Copy the provided URL and paste it into your browser to view the output.

Run Replace with Image

Step 10: Image Replacement Output

Here's the output showing where we have replaced the text with an image.

Image Replacement Output

Since the URL generated by PDF.co is temporary and expires after 1 hour, we will save the file to a cloud storage service such as Google Drive, Dropbox, OneDrive, or any other preferred cloud storage solution for permanent storage, ensuring it can be accessed at any time.

Step 11: Google Drive Upload File

Let's integrate the Google Drive module to upload the generated file for permanent storage.

Google Drive Upload File

Step 12: Setup Google Drive

  • Select the "Choose from the list" option to enter a File ID.
  • Choose "My Drive" as the drive to be used.
  • Specify the folder name where you want to upload the file.
  • Use the Map option to input the file name and data.
Setup Google Drive

Step 13: Run Scenario to Upload File

Now, let's run the scenario to upload the file to a specific folder in Google Drive. After uploading, open the Google Drive folder to view the uploaded file.

Run Scenario to Upload File

Step 14: Google Drive Folder

Here is the file that we successfully uploaded to Google Drive folder.

Google Drive Folder

In this tutorial, we explored the powerful capabilities of PDF.co for modifying PDF documents, demonstrating how to replace existing text with new text and how to replace text with an image. These features are incredibly useful for updating outdated information, personalizing documents, or adding visual elements to enhance readability.

Related Tutorials

See Related Tutorials