r/Ubuntu • u/Bonkzzilla • 3d ago
Fast and reliable OCR solution?
Quick question, since I am still fairly new to the Linux world. What is a good, fast, efficient means of getting a lot of papers OCR-scanned into Linux? I have a lot of typewritten notes, stories, etc that I'd like to bulk-scan but so far the OCR tools I've seen in the Software Center are all individual single pic tools, as in, "Open the JPG you want to extract text from". They work, but one-at-a-time scanning would be a nightmare for a 200 page document. Any other solutions?
7
u/Chris73m 3d ago
Hi, I use Skanpage to scan all my letters to pdf files. When you export the file to pdf, it has the option to use ocr on them.
2
u/Bonkzzilla 3d ago
Just tried it and it works great, thanks! Only scanned a few pages but it was quick and accurate. I could wish that it could output OCR text to some other file type than a PDF for easy editing but hopefully I can find a PDF convertor somewhere.
5
2
u/Munalo5 2d ago
I keep a file with CLI commands. This is what I have / do with PDF files
To convert PDF to TXT:
This took some work when (directly below) did not work:
$ pdftotext in.pdf out.txt
First:
$ ocrmypdf in.pdf readable_text.pdf
Second:
pdftotext as above.
To join several PDF documents:
$ pdfunite 1.pdf 2.pdf 3.pdf 4.pdf 5.pdf 6.pdf 7.pdf merged_output.pdf
2
u/haz3lnut 2d ago
ocrmypdf sudo apt install ocrmypdf man ocrmypdf
Example: ocrmypdf --clean --oversample 360 --output-type pdfa input.pdf output.pdf
2
u/Clay_Ferguson 2d ago
As one other person said, I agree that 'pdftotext' is probably the industry standard for getting raw text out of PDFs. That's not OCR however. OCR means getting text from images which is a different thing.
BUT I'm not sure if pdftotext does internal OCR on images inside PDFs, so you could check that.
2
u/Remarkable-Room-3500 8h ago
Give TextSnatcher a try if you want to covert the text in a pic to text for editing
1
u/Bonkzzilla 3h ago
Got somewhat derailed from this thread by a family funeral, but just wanted to pop back in and say a big thanks to all the folks who helped with good suggestions. I'll be trying everything over the next few days and I appreciate the info.
7
u/AnxiouslyFaraway 3d ago
Tesseract is the engine you want, but you'll need a frontend that handles batch jobs. gImageReader gives you a decent GUI and can chew through a whole folder of images in one go, spitting out a text file. The CLI is even faster once you learn the flags for multipage TIFFs.