How to Extract Specific Rectangular Area in PDF using PDF.co and Make

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

We will use this sample PDF invoice to extract the specified rectangular area.

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 the File ID field, enter the specific folder where the file resides.
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.

  • For the API Endpoint Path field, enter the v1/pdf/convert/to/text. This endpoint will extract the specific rectangular area in a PDF.
  • 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.
  • Under the Body param, type rect for the Key and enter the rectangular area value of x,y,width,height. You can easily get the rectangular area value using the Bytescout PDF Multitool.
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

In this tutorial, you learned how to extract specific rectangular areas in PDF using Make. You learned how to use the PDF.co Web API and extract the specific rectangular area in a PDF. You also learned how to get the rectangular area value of a PDF using the Bytescout PDF Multitool.