
Email-to-Booklet: Parse, Personalize, and Merge Legal PDFs with n8n + PDF.co
6 MIN READ
What You'll Have When Done: A setup that can automatically run OCR in scanned PDFs, identify the type of document (like an invoice or purchase order), and sort the files into the right folders. Useful for organizing common business documents without manual effort.
Before you begin, make sure you have:
Follow the 5-step guide below to create the automation from scratch.
Node: Google Drive Trigger
Settings:
Changes Involving a Specific FolderFile CreatedSuccess Looks Like: The trigger activates immediately when a new scanned file is added to your watched folder.
Node: PDF.co API → Make PDF Searchable or Unsearchable
Settings:
={{ $json.webContentLink }}Make PDF SearchableEnglish (Adjust for your documents)={{ $json.originalFilename }}What This Does: Applies OCR to scanned, image-based PDFs and adds an invisible text layer, making the document fully searchable and selectable without altering its visual appearance.
Success Looks Like: PDF.co processes the document and returns a URL to the searchable version. The response includes the processed file URL that can be used for classification.
Node: HTTP Request → PDF.co Document Classifier
Settings:
POSThttps://api.pdf.co/v1/pdf/classifierx-api-key: Your PDF.co API keyContent-Type: application/json{
"url": "{{ $json.url }}",
"rulescsv": "Invoice, OR, Invoice Number, Invoice #, INVOICE NO\nPurchase Order, OR, PO Number, Order Number, Order No\nBill, OR, Bill Date, Billing Period, Bill Number"
}The rulescsv parameter defines how documents are classified. Format: FolderName, OR, keyword1, keyword2, keyword3
Examples:
Invoice, OR, Invoice Number, Invoice #, INVOICE NOPurchase Order, OR, PO Number, Order Number, Purchase Order NoReceipt, OR, Receipt, Transaction, Purchase DateContract, OR, Agreement, Contract, Terms and ConditionsStatement, OR, Statement, Account Statement, Monthly StatementSuccess Looks Like: PDF.co analyzes the OCR'd document content and returns a classification result with the matched category name. The response includes a classes array with the best match.
Node: Google Drive → Search files and folders
Settings:
File/Folder={{ $json.body.classes[0].class }}Success Looks Like: The search returns the folder that matches the classification result. If "Invoice" was classified, it finds your "Invoice" folder.
Node: HTTP Request (Download OCR'd File)
Settings:
GET={{ $('PDFco Api').item.json.url }}What This Does: Downloads the OCR-processed, searchable PDF file so it can be uploaded to the destination folder.
Success Looks Like: The processed file is downloaded and ready for upload to the classified folder.
Node: Google Drive → Upload file
Settings:
dataMy Drive={{ $json.id }} (from the search result in Step 4)Success Looks Like: The processed, searchable file appears in the correctly classified destination folder.
Congrats! You’ve built an intelligent system that OCRs, classifies, and auto-organizes scanned PDFs into searchable, properly filed documents.
Your team can now simply scan and drop documents into one folder, and watch them get automatically processed and organized without any manual intervention.
Built something cool? Share it with us @pdfdotco

6 MIN READ

6 MIN READ

6 MIN READ

6 MIN READ
Create an account, get an API key and test a request.