How to batch rename PDF files based on their content
You want invoice (3).pdf to become 2026-09-30 Acme Telecom €54.20.pdf, for a few hundred files at once. The date, supplier and amount are right there on the page. Getting a computer to read them and use them in the file name is harder than it looks. Here are the routes that work, and what each one asks of you.
Why normal bulk renamers can’t do it
Bulk renamers work from what Windows already knows about a file: its name, dates and properties. Bulk Rename Utility, a popular Windows renamer, can use photo EXIF data, music tags and Windows file properties.1 Its manual mentions PDF metadata, meaning the document properties, not the text printed on the page.3 It’s free for personal use at home, but businesses need a commercial licence for each computer it’s installed on.2
Microsoft’s free PowerRename has the same limit: it can add a date, but not the supplier or amount. See how to rename scanned receipts automatically for that route.
Two separate problems
- Getting the text out. Invoices you download usually have real text in them. Scans and phone photos are just pictures until something runs OCR (optical character recognition) on them.
- Finding the right bits. Every supplier puts the date, total and VAT in a different place, and writes dates differently. This is where most do-it-yourself setups break down.
Route 1: OCRmyPDF and pdftotext (free, technical)
OCRmyPDF adds a searchable text layer to scanned PDFs using the open-source Tesseract engine. It’s MPL-2.0 licensed and supports Windows, macOS and Linux.45 For one scan:
ocrmypdf scan_0034.pdf scan_0034-ocr.pdf
pdftotext, part of the Poppler tools, converts a PDF to plain text.6 This prints the text so you can see what a script would have to work with:
pdftotext -layout scan_0034-ocr.pdf -
From there, you need a script that finds the date, supplier and total in that text and renames the file. Writing one that copes with your own suppliers is doable. Writing one that copes with a new supplier next month is the hard part.
Good for: people comfortable with scripts and a fixed set of suppliers.
Route 2: Power Automate Desktop (Windows)
Microsoft’s Power Automate Desktop has an Extract text from PDF action that puts the page text into a variable.7 Its OCR engines are installed with it and work locally, without connecting to the cloud, but its OCR action reads screens and image files, not PDFs directly.8 Microsoft also notes that its table action can’t read non-copyable text from scanned PDFs.7
You build a flow: extract the text, pick out the date and amount, then rename the file. It’s visual rather than code, but you still have to tell it where each supplier puts each detail.
Good for: Microsoft 365 workplaces that already use Power Automate.
Route 3: Paperless-ngx (self-hosted)
Paperless-ngx is a free, open-source document system. It runs OCR on scans, uses machine learning to suggest correspondents and tags, and keeps your data on your own server.9 It can name stored files from document details, for example {{ created_year }}/{{ correspondent }}/{{ title }}.10
The catch is the setup. The project says the easiest way to install it is with Docker Compose, and that it should never be run on an untrusted host, because information is stored without encryption.11 An amount in the file name would need a custom field.10
Good for: people happy to run and maintain a small server.
Route 4: a cloud parser (Zapier and Docparser)
Automation services can do the reading for you. Zapier’s Docparser integration, for example, uploads each document to Docparser, which starts parsing it as soon as it arrives.12 It’s the least technical route, but every invoice now goes to two outside companies. For business records, check that with whoever handles data protection.
Side by side
| Route | Files leave your PC | Reads scans | Setup |
|---|---|---|---|
| OCRmyPDF and pdftotext | No | Yes, with OCRmyPDF | Command line and a script |
| Power Automate Desktop | No, for the steps above | Not from PDFs directly | A flow per layout |
| Paperless-ngx | To your own server | Yes | Docker and a server |
| Zapier and Docparser | Yes | Depends on the parser | Account and templates |
Whichever route you pick
- Work on a copy of the folder until you trust the results.
- Preview before renaming. Print the old and new names side by side and read them.
- Plan for clashes. Two €54.20 phone bills on the same day need different names, so add an invoice number or a counter.
- Keep a log of old name to new name, so you can put things back.
- Use a convention. Decide the pattern first. Our file naming convention for receipts and invoices is a good start.
Bulk Rename Utility, OCRmyPDF, Poppler, Power Automate, Paperless-ngx, Zapier and Docparser belong to their owners. We are not affiliated with any of them.
Sources
- Bulk Rename Utility: home page
- Bulk Rename Utility: licensing
- Bulk Rename Utility: user manual (PDF)
- OCRmyPDF documentation
- OCRmyPDF on PyPI
- pdftotext manual page (Poppler)
- Microsoft Learn: Power Automate desktop PDF actions
- Microsoft Learn: Power Automate desktop OCR actions
- Paperless-ngx documentation
- Paperless-ngx: file name handling
- Paperless-ngx on GitHub (README)
- Zapier: Docparser integrations
Comments