This guide uses Google Sheets, but it can also be helpful for users of other apps like Xero and QuickBooks.
How to Split a Multi-Page PDF Invoice and Extract Data using Make
This tutorial will show you how to split a large PDF with 5 invoices into individual files by finding a specific keyword. You'll learn to extract details from each invoice and add them to a Google Spreadsheet using PDF.co API and the Make platform.
![Sample PDF Invoice](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F2niroq9z%2Fproduction%2Ff801fa2fecac59b33761889620425a623060f1d4-780x435.png&w=1920&q=75)
Note
(Using Zapier? Check out this tutorial.)
Here are the steps to automate the process using PDF.co and Make.
Contents
Step 1: Google Drive Watch Files in Folder
Let’s start by using the Google Drive “Watch Files in a Folder” option to allow you to monitor changes made to files within a specific folder on your Google Drive. When this feature is enabled for a folder, Google Drive will automatically notify you of any new files added, existing files that have been modified, or files that have been deleted from that folder.
Step 2: Setup Google Drive Configuration
- Select "By Created Time" to Watch Files.
- Choose "My Drive" as the Drive to be used.
- Enter the Folder name that you want to watch.
- Select "All" for File Types to Watch.
- Enter the limit value for the number of results to be processed during one execution cycle.
![Google Drive Configuration](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F2niroq9z%2Fproduction%2F2f8766d6564c13a95682d14900d6367f7456e1b7-780x660.png&w=1920&q=75)
Step 3: Google Drive Download a File
Add another Google Drive module and select the "Download a File" feature to download the PDF file you need to process.
Step 4: Setting Up Google Drive
- Choose the "Select from the list" option to enter a File ID.
- Select "My Drive" as the Drive to be used.
- Enter the folder and file name you would like to use.
![Google Drive Set Up](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F2niroq9z%2Fproduction%2Febd450768114405eec666bca92ac5520f65c2f6c-780x520.png&w=1920&q=75)
Step 5: PDF.co Split a PDF Module
Let's use the PDF.co Split a PDF feature to split the PDF invoice into individual invoices based on a text search, after setting up the integration with Google Drive.
Step 6: Split a PDF Configuration
- Select the 'Upload a file' option to automatically input the downloaded PDF file from Google Drive.
- Then, choose the 'Split by Text Found or Barcode' feature to split the PDF invoice into individual invoices using a text search.
- Enter the keyword or text you want to use to split the PDF in the Search String field.
![Split a PDF Configuration](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F2niroq9z%2Fproduction%2F30f52ec18200b3ad1ddc79e42546d5e2b8ddf162-780x815.png&w=1920&q=75)
Step 7: Run Scenario to Split Invoices
After set up, run the scenario to split the PDF invoice into individual invoices.
![Output](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F2niroq9z%2Fproduction%2Fac526c7cd6f113e4d122c8de20b14028f57bf9d4-780x785.png&w=1920&q=75)
Step 8: Iterator Tool
Let's use the Iterator tool to loop through each URL and extract text from each invoice one at a time.
![Iterator Tool](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F2niroq9z%2Fproduction%2Fbdf55cf8ccc7ae7521371d66f5b90dfa8bac8282-780x325.png&w=1920&q=75)
Step 9: PDF.co Parse a Document Module
Next let's add the 'PDF.co Parse a Document' module to parse the data from all the individual invoices.
Step 10: Setup Parse a Document Module
- Select the 'Import a file from URL' option to input a file URL.
- Then, enter the Iterator URL value.
- Finally, add the Document Parser Template ID. If you are new to Document Parser and haven't created a template yet, please visit the Document Parser Manager here: https://app.pdf.co/document-parser-tool/playground/choose-template-group
![Document Parser Configuration](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F2niroq9z%2Fproduction%2Fbb600f6ca1ad47d7b6eed61885bc615c12dac209-780x855.png&w=1920&q=75)
Step 11: Run Scenario to Parse Data
Now, let’s run the scenario to parse the data from each individual invoice.
![Parse Data](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F2niroq9z%2Fproduction%2F941fdfee27727ec792520b62a668a7576eb71227-780x635.png&w=1920&q=75)
Step 12: Google Sheets Module
Now that we've parsed the data from all the invoices, let's add the Google Sheets module and map the extracted data to the corresponding fields in Google Sheets.
Step 13: Setup Google Sheets Module
- Choose the 'Select by path' method.
- Select 'My Drive' as the drive.
- Enter the Spreadsheet ID and Sheet name.
- Map the parsed data values to the respective columns in the Google Sheet.
![Google Sheets](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F2niroq9z%2Fproduction%2F3ed500d547a454beac1496ff96e799d509543665-780x570.png&w=1920&q=75)
![Values](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F2niroq9z%2Fproduction%2Fec35b4a528f1def3a7dcfb8539c2d58962fa2b4b-700x660.png&w=1920&q=75)
Step 14: Run Scenario and View Result
Now, run the scenario and open Google Sheets to review the result.
![Google Sheets](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F2niroq9z%2Fproduction%2Fc85e30c670be8e7fedb9842f05ea264b3bf3cc51-780x325.png&w=1920&q=75)
In conclusion, this tutorial has shown you how to efficiently split a large PDF with multiple invoices into individual files using a specific keyword. By using the PDF.co API and the Make platform, you can easily extract invoice details and add them to a Google Spreadsheet. This automated process simplifies invoice management, enhances data accuracy, and saves time, allowing you to focus on more important business tasks.