Scanned PDFs to Markdown, offline: how OCR fits in and where it fails
A scanned PDF contains no text at all, only a picture of a page. To turn it into Markdown you need optical character recognition (OCR), and then everything described in the PDF article on top, because OCR gives you words with positions, not paragraphs.
Why “offline” matters for scans
The documents people scan are the private ones: tax forms, contracts, bank statements, medical letters, signed agreements. Most online “PDF to text” services upload the file to a server, keep it for some period, and may use it to train models. For a restaurant menu that is fine. For a 1099 it is not.
Anymark’s OCR runs entirely on your Mac or PC, using the open-source Tesseract engine with English built in and twenty more languages available from the menu. Nothing leaves the machine.
What happens to a scanned page
- Orientation. Pages fed sideways or upside down are detected and turned. The engine tries the page the right way up first and only rotates when the text reads badly.
- Cleaning. Show-through from the back of the sheet, scanner noise and JPEG haze are removed; ruling lines and table borders are lifted out so they are not read as letters, then put back as table structure.
- Recognition. Words come back with confidence scores. Doubtful words are read a second time from the uncleaned scan and the two readings are compared.
- Reconstruction. Lines are grouped into paragraphs, headings found by size, lists by their markers, tables from the lifted rules and from alignment. Bold text is detected from stroke weight.
- Pictures. Logos, barcodes, signatures and stamps are cut out as images and placed where they were.
Where it fails, honestly
- Low resolution. Below about 150 dpi, letters merge and OCR guesses. Rescan at 300 dpi if you can.
- Handwriting. Printed text only. A handwritten note comes out as a picture, which is the right outcome.
- Photographs on the page. A page with a photograph can lose the photo or read words inside it as text. This is a known weakness being worked on.
- Skewed scans with wide line spacing. A page rotated a degree or two with generous spacing can come out one paragraph per printed line. Straight scans are fine.
- Dollar signs and columns of amounts. A
$can be read as1orS, and amounts in a form box occasionally split. Check the numbers on anything financial, every time, with every OCR tool.
Practical advice
Scan at 300 dpi, black and white or greyscale, straight on the glass. Convert, then read the result against the original once; OCR is good enough that a two-minute check catches what is left. Keep the scan: Anymark never modifies it, and the Markdown sits beside it.