New: PDF to E-Invoice for Factur-X/ZUGFeRD, and PDF to PDF/A for archive-ready PDF/A-3b.

Extract Text from a Rectangular Area of a PDF Using Make

In this tutorial, we will show you how to extract specific rectangular areas in PDF using PDF.co and Make.

This tutorial uses PDF.co’s PDF-to-text operation to read text from a selected rectangular area of a PDF. The output is text, not a cropped image or a new PDF containing the selected region. Use the sample invoice to check the extraction area before sending the result to another application.

Screenshot of Sample PDF
Screenshot of Sample PDF

Step 1: Create a New Scenario

  • First, open your Make account and click on the Create a New Scenario button.

Step 2: Google Drive Module

  • Next, select the Google Drive app and choose the Download a File module.
Google Drive Module

Step 3: Google Drive Configuration

Let’s set up the Google Drive configuration.

  • For the Enter a File ID field, enter the Select from the list option.
  • In the Choose a Drive field, select My Drive.
  • In File ID, select the specific PDF file to download, not its containing folder. If a preceding module finds or watches files, map that module’s file ID into this field.
Google Drive Configuration

After setting up the configuration, run the scenario to fetch the file from your Google Drive.

Step 4: Add PDF.co Module

  • Let’s add another module and select PDF.co. Then, choose the Make an API Call module.
Add PDF.co Module

Step 5: PDF.co Configuration

Let’s set up the PDF.co configuration.

  • API Endpoint Path: Enter /pdf/convert/to/text. The Make module already uses https://api.pdf.co/v1 as its base URL.
  • For the Input Type field, select the Upload files and inject as ‘url’ param option. It will automatically input files from Google Drive.
  • For the Output File Name field, enter the desired name of the output file.
  • Body: Set the key to rect and enter the existing coordinate values as a space-separated string: x y width height, not comma-separated values.
PDF.co Configuration
PDF.co Configuration

Once you are done setting up the configuration, you may now run the scenario to see the result.

Step 6: Run Scenario Result

  • Great! We successfully run the scenario. Copy the URL and paste it into your browser to view the output.
Run Scenario Result

Step 7: Output

  • Here’s the extracted text output using the rectangular area with PDF.co and Make.
Extracted Text Output
Extracted Text Output

You have extracted text from a selected rectangular area of a PDF using PDF.co and Make. Compare the output with the source region to confirm that the required text is included and unrelated content is excluded.

Related Tutorials

See Related Tutorials