This tutorial shows how to automatically search a PDF for specific text using PDF.co and Zapier. PDF.co can search both regular and scanned PDF documents.

We will use Google Drive as the trigger, but you can substitute another app that supplies a PDF file.

Step 1: Set Up the Google Drive Trigger

  1. Sign in to Zapier and create a new Zap.
  2. Select Google Drive as the trigger app.
  3. Choose New File in Folder as the trigger event.
  4. Connect your Google Drive account.
  5. Select the drive and folder that will receive the PDF files.
  6. Test the trigger and select a sample PDF.

Step 2: Add the PDF.co Search Action

  1. Add another step to the Zap.
  2. Select PDF.co as the app.
  3. Choose Search in PDF as the action event.
  4. Sign in and authorize access to your PDF.co account.

Step 3: Configure the Search

Complete the PDF.co action fields:

  • Source File URL: Map the PDF file from the Google Drive trigger. When available, select the File value.
  • Search Query: Enter the text you want to find, such as Invoice Number.
  • Enable Regular Expressions: Enable this option only when the search query is a regular expression.
  • Page Range: Leave this blank to search the entire document. To limit the search, enter zero-based page indexes or ranges, such as 0, 0-2, or 0,2,4.
  • Custom Profiles: Leave this blank unless your workflow requires advanced processing options.

PDF.co can also search for patterns. For example, the following regular expression searches for a US Social Security number format:

[0-9]{3}-[0-9]{2}-[0-9]{4}

See the PDF.co Search Text documentation for details about search settings, page ranges, and returned fields.

Step 4: Test the Search

Test the PDF.co action using the sample PDF.

A successful result includes the matches found in the document. Each match can contain information such as:

  • The matching text
  • The page index
  • The match coordinates
  • Surrounding text or other search details

Review the results and confirm that PDF.co found the expected text.

Step 5: Use the Search Results

Add another Zapier action based on what should happen after a match is found. For example, you can:

  • Add the result to Google Sheets.
  • Send an email or Slack notification.
  • Use a filter to continue the Zap only when matching text is found.
  • Route the document to another processing step.

Test the complete Zap, then publish it. New PDFs added to the selected Google Drive folder will now be searched automatically.

Now, you know how to do a text search within a PDF file using PDF.co and Zapier integration.

To learn more about specific tasks with PDF.co Web API, check out our Tutorials.

Related Tutorials

See Related Tutorials