Portfolio / Invoice PDF extractor
Invoice PDF extractor
Three invoices, three different layouts. Hit Extract and watch the fields get found, the math get checked, and a spreadsheet build itself.
Hit Extract and watch the fields light up. It’s oddly satisfying.
Meet Rosa, who does the books for a small construction company.
Vendors email PDF invoices all month long, each in its own layout. Rosa types every one into a spreadsheet: vendor, invoice number, dates and total. It's slow, and every so often an invoice charges more than its own line items add up to, which is easy to miss when you're just typing the total.
Example scenario: the people and businesses on this page are made up.
Before
- Around 60 vendor invoices a month, all PDFs, all different
- Each one typed into a spreadsheet by hand
- A sign company overcharged by $40 and nobody caught it
- Two days of typing at the end of every month
After
- Every field pulled out automatically
- The math checked on every single invoice
- Overcharges flagged before they get paid
- One clean spreadsheet, ready for the books
Try it yourself
invoices.xlsx
Extracted invoices will show up here.
| Vendor | Invoice # | Date | Due | Total | Check |
|---|
A simulation in your browser using three sample invoices. The real tool runs in Python on your own PDF files.
What this could be worth to you
Typing invoices is slow, and checking the math on every one catches billing errors.
Example numbers to start you off. Move the sliders to match your business. These are estimates, not a guarantee or financial advice; your results depend on your situation.
The problem
Invoices arrive as PDFs in every possible layout, so someone has to read and retype each one, and nobody has time to double-check the math.
The solution
A Python tool that reads each PDF, finds the fields that matter wherever the vendor put them, adds up the line items to check the total, and writes everything to one spreadsheet, with anything suspicious marked "Needs review".
How it's built
- GatherPoint it at the folder where invoices are saved.
- ReadPull text and tables out of each PDF.
- FindLocate vendor, number, dates and totals in any layout.
- CheckAdd up line items and compare with the total.
- ExportOne spreadsheet, with problems flagged.
A simplified version of the Python behind it:
from pathlib import Path
import pdfplumber, pandas as pd
rows = []
for path in Path("Invoices/October").glob("*.pdf"):
with pdfplumber.open(path) as pdf:
page = pdf.pages[0]
text, table = page.extract_text(), page.extract_table()
total = find_total(text)
lines = sum_line_items(table)
rows.append({"file": path.name, "vendor": find_vendor(text), "total": total,
"check": "OK" if abs(total - lines) < 0.01 else "Needs review"})
pd.DataFrame(rows).to_excel("invoices.xlsx", index=False)
What it makes possible
- Hours of retyping turned into minutes
- Overcharges caught before they get paid
- A clean record of every invoice for the books
Skills shown
More to try
Stop typing invoices by hand
Tell me what your invoices look like, and I'll build a reader for them.
Starting prices are for smaller projects. Bigger or more complex jobs are priced by scope: how much there is and how long it takes.