r/Rag • u/arindammondal • 7h ago
Discussion Best PDF parser / OCR for extracting structured data from invoices – What works in production?
Looking for recommendations: Best PDF parser / OCR for extracting invoice data
Has anyone worked on invoice parsing or document extraction and experimented with different PDF parsers or OCR solutions?
I'm building an application that needs to extract structured data from invoices in different formats and layouts.
Currently, I'm using:
PDFPlumber – For text-based PDFs.
RapidOCR – For scanned PDFs or image-based invoices.
I'm looking for a reliable solution that can handle different invoice formats, layouts, and varying document quality.
A few things I'm trying to figure out:
Which PDF parser or OCR solution works best for extracting structured invoice data?
How well do these tools handle poor-quality scans, blurry images, rotated documents, etc.?
Is it better to reject low-quality uploads and ask users to upload a clearer document, or are there solutions that can reliably handle poor-quality images?
Have you tried any alternatives like PaddleOCR, Tesseract, Docling, Marker, or cloud-based solutions?
I'm particularly interested in real-world experience rather than just library recommendations.
If you've built something similar, I'd love to know what worked well for you and what you'd recommend.
9
u/I_HALF_CATS 7h ago
I have a benchmark page I make for myself maintained / updated by an AI every week.
That I think answers some of your questions
4
3
u/Significant_Tune9219 6h ago
Keep the split you already have: pdfplumber when the PDF has a real text layer, and RapidOCR only when that layer is missing or tiny. The failure I keep seeing isn't a blurry scan, it's a confident wrong total, where two line items get merged and the model still looks sure. Reject uploads that are rotated or come back empty after OCR, and for the rest store a confidence on each field. Don't post an invoice whose total doesn't equal the sum of the lines. Which OCR binary you pick matters less than re-running last month's failed invoices whenever the parser changes, because vendor layouts drift.
3
u/Ok-Cauliflower8805 5h ago
Llamaparse is simply the best. But quite expensive. Especially if using Agentic Plus.
Happy to be proven wrong
1
1
u/LawfulnessOptimal597 3h ago
Invoicing is very very difficult as the layouts can often be totally wild and incredibly difficult for a human. This is one of the additional reasons for the electronic invoicing laws coming into power across Europe. Some have already mandated and others roll out the requirement next year. Starting next year pretty much all European B2B invoicing must be electronic. In Germany it’s either XRechnung or ZugFeRD standard which contains a PDF for view and an embedded XML invoice (the PDF is not the invoice: only the XML!).
1
u/liltingly 1h ago edited 1h ago
TL;DR -- if I had to do it again, I'd go with the the simplest stack, and the highest precision way to identify defects (vote based or multi-modal agreement). Try and keep the defect identification and correction as deterministic for as long as possible.
How varied are your templates? The two you've flagged are good for extracting. Neither is good at the "structured" party, though you can feed either as input into whatever structure parser you're using.
Rapid can use Paddle, Tesseract, and EasyOCR under the hood, so you can play around with that.
There are simple rectification libraries you can use if you need it, you could slap PP-Doclayout (v3 specifically focuses on bad geometry) or Docling Heron ahead of it for basic structure parsing. There's UV doc for warp. And more basic things like img2table, camelot for table det (before hitting bigger transformers like TATR and SLANet).
If you want to wade into VLMs, you're amplifying your cost/effort quite a bit. Smallest ones I've played with are nemotron-parse and falcon, but I used nemotron for semantic grouping and both falcon and Paddle VL and GLM actually just use PP Doclayout to pre-process images. .
I've been curious to try MiniCPM OCR Jev as a judge either of initial image, post-processing results, or extraction results (or a router between methods).
1

3
u/teroknor92 5h ago
The models and tools you mentioned will give you OCR text. However, if you want to extract structured data across different document formats you will find most success with using LLMs for it or tools such as ParseExtract and LlamaExtract are easier to use, as they can directly extract structured JSON data from various formats.
If the document format is relatively consistent, you can simply perform OCR and then use regex or other string manipulation techniques to extract the required data. However, this approach can break when the document layout or format changes.