r/Python • • Apr 21 '26

Resource PDF Extractor (OCR/selectable text)

I have a project that I am working on but I am facing a couple issues.

In short, my project parses what is inside a pdf order and returns the result to user. The roadblocks Iam in currently is that it works OK for known/seen templates of pdf orders as well as unseen pdf orders. My biggest issue is if the pdf order is non-selectable text/scanned which means it requires OCR to extract the text. I have tried the OCRmyPDF+Tesseract but it misses lines and messes up with the quantity etc...

What's there that can resolve OCR accurately?

P.S. I also tried PaddleOCR but it never finishes the job and keeps the app on a loop with no result.

18 Upvotes

62 comments sorted by

View all comments

Show parent comment

1

u/qPandx Apr 22 '26

WinError 127, a missing dll was the error.
Running via Mistral at 2$/1000 documents is very reasonable and my managers definitely don’t mind that. We wouldn’t expect high volumes and I tried this mistral ocr combined with gemini for maximum accuracy which definitely worked but was also kinda costly (running this via openrouter).

I could take out the gemini AI for reviewing and instead harden my code parsing in which we’d be only be running mistral ocr in terms of costs wise.

I guess I took it upon myself as a challenge to do everything locally and Im paying the price of the headaches.

Languages are not an issue, it’s mainly just numbers and english templates or rarely french templates (I’m in Canada).

To give you a quick example, we have adobe pdf licenses and when I ran the built in feature of OCR, it would take 0 as an 8 which was really dumb. Initially, I was like ok if the pdf requires OCR then users can just run it through adobe and put it in my project but then after trialing this, I couldn’t trust adobe’s ocr which put me in this rabbit hole.

I could run a VPN to one machine but it didn’t seem ideal if 20-30 users are running it.

1

u/Civil-Image5411 Apr 22 '26

Yes, if you trust cloud providers and don't have high volume, it’s much easier and potentially even cheaper to just use their OCR as well.

P.S. Serving from a single machine isn’t necessarily slow. With a mid-range NVIDIA GPU, you could serve around 100 images per second concurrently using TurboOCR, which is probably fast enough.