Managing and organizing documents can be a hard task especially when dealing with large files that contain sensitive information. Removing specific pages from these files can be time-consuming and require expertise. With PDF.co managing documents has become more accessible and efficient.

PDF.co is a cloud-based tool that allows users to perform a wide range of operations on PDF files. Its user-friendly interface and comprehensive set of features make it an ideal choice for businesses and individuals looking to simplify their document management process.

In this tutorial, we will guide you through the process of searching text from a PDF document and removing a page containing a specific keyword from a PDF file using PDF.co and Make. So let’s get started!

  1. Create a New Scenario
  2. Add Google Drive Module
  3. Setup Google Drive
  4. Google Drive Result
  5. Add PDF.co Module
  6. Setup PDF.co Configuration
  7. PDF.co Result
  8. Add Another Module
  9. Delete Pages Configuration
  10. Run Scenario Result
  11. Deleted Pages Output

We will be using a sample PDF document with multiple pages to demonstrate how to search for text in a PDF file and remove the pages containing the specified keyword.

Sample PDF Document with Multiple Pages
Sample PDF Document with Multiple Pages

Here is the simple step-by-step guide to search for text in a PDF file and remove the pages containing the specified keyword:

Step 1: Create a New Scenario

  • To get started, you’ll need to log into your Make account and Create a new scenario.

Step 2: Add Google Drive Module

  • Next, proceed to add Google Drive app, and then select the Download a File option to obtain the file from your Google Drive folder. Alternatively, you can use any other cloud storage platform of your choice to acquire the PDF file.

Add Google Drive Module

Step 3: Setup Google Drive

Let’s set up your Google Drive settings for Make.

  • Begin by connecting your Google Drive account to Make. This step authorizes Make to access your Google Drive account and download the specified file.
  • Once your Google Drive account is connected, configure the Download a File action by selecting Select from the list in the File ID field.
  • In the Drive field, select My Drive as the drive to be used. This ensures that the file is downloaded from your personal Google Drive account.
  • Finally, enter the name of the folder and file you wish to download from your Google Drive account. Be sure to enter the exact folder and file name to ensure that the correct file is downloaded.

Google Drive Configuration
Once you have completed the configuration steps, you can proceed to run the scenario and retrieve the desired file from your Google Drive folder.

Step 4: Google Drive Result

  • Great! The scenario ran successfully and retrieved the file from your Google Drive folder. Now, let’s take it a step further by integrating another application. We will search for specific text in PDF documents and remove any pages containing the specified keyword.

Google Drive Result

Step 5: Add PDF.co Module

  • In this step, we will integrate the PDF.co app and select the Search Text in PDF feature to locate specific text within the PDF document.

Add PDF.co Module

Step 6: Setup PDF.co Configuration

Let’s set up the configuration for PDF.co.

  • Begin by connecting your PDF.co account to Make by adding your API Key, which you can obtain from your PDF.co dashboard or by signing up through this link.
  • Select the Upload a file option in the Input File field to automatically fetch the downloaded file from Google Drive.
  • Add the specific text that you want to search for within the PDF document.

Setup PDF.co Configuration
After configuring the PDF.co settings, you can now proceed to run the scenario to search for the specified text within the PDF document.

Step 7: PDF.co Result

  • Excellent! PDF.co has successfully searched for the specified text within the PDF document and provided an output URL containing the results. Let’s continue by adding another application and deleting the page that contains the specified keyword.

PDF.co Result

Step 8: Add Another Module

  • Let’s proceed with integrating another application by selecting PDF.co and choosing the Make an API Call option. This will allow you to utilize the PDF delete pages endpoint and remove the page that contains the specified keyword.

Add Another Module

Step 9: Delete Pages Configuration

Let’s configure the settings to delete the page from the PDF document.

  • Input the PDF Delete Pages endpoint to remove the specific page from the PDF document.
  • Choose the Upload files and inject as `url` param option to automatically upload the downloaded file from Google Drive.
  • Specify the desired name for your output file.
  • Under the Body parameter, enter pages for the key and input sum(2.body[].pageIndex; 1) for the value. This value will delete the page based on the specified keyword.

Setup PDF.co Configuration
Setup PDF.co Configuration
After successfully configuring the settings to delete the page containing the specified keyword, run the scenario to remove the specific page from the PDF document.

Step 10: Run Scenario Result

  • Congratulations! We successfully deleted the specific page containing the keyword from the PDF document. Copy the URL and paste it into your browser to view the output.

Run Scenario Result

Step 11: Deleted Pages Output

  • Here is the revised PDF document that does not include the deleted page.
PDF Delete Pages Output
PDF Delete Pages Output

This tutorial taught you how to remove pages from PDF documents that contain certain keywords, utilizing PDF.co and Make. You gained knowledge on how to use the PDF.co PDF Search Text API to search for particular text in PDF files and the PDF.co PDF Delete Pages endpoint to remove pages from PDF documents.