Ask one question before choosing anything
Does this PDF already contain text, or is it a picture of a page?
Everything follows from the answer, and it takes five seconds to find out. If you can select and copy text in a PDF viewer, the text is there. Or:
pdftotext -layout report.pdf - | head -20If that prints words, the text layer exists and extraction is exact. If it prints nothing, the file is images and you need recognition, which is approximate.
People routinely send a text-layer PDF through a vision model, pay for it, wait for it, and receive a version with one digit changed. The text was sitting there.
The free tools, in order of what you should reach for
pdftotext (from Poppler): exact extraction from PDFs with a text layer. -layout preserves column structure.
Tesseract: the long-standing free OCR engine. Good on clean printed pages, weaker on complex layouts, supports over 100 languages including Indic and Arabic scripts.
PaddleOCR and docTR: free, more accurate than Tesseract on messy layouts, better on non-Latin scripts, more setup.
Docling and similar document-conversion tools: free libraries that turn PDFs into structured Markdown, preserving headings and tables, which is exactly the shape a model reads best.
LibreOffice: converts almost any office format to any other from the command line, free, and useful in a pipeline.
libreoffice --headless --convert-to pdf *.docx
tesseract scan.png out --psm 6 -l eng+hinWhere a vision model is the right tool
Not for exact characters. For layout and meaning: which of these is the invoice total, what does this form ask for, what is this diagram showing, is this table structured by row or by column. A vision model reading a page it can see, alongside text you extracted exactly, is a strong combination.
The general shape for a document pipeline: extract text with the exact tool, use the model to interpret, and check any number that matters against the source.
Tables, which are the hard part
Tables are where document extraction fails most often, in both routes. A table split across a page break, or with merged cells, or with a header repeated halfway down, confuses text extraction and vision models alike.
Two practical measures. Ask for the output in a structured form you can validate (a list of rows with named fields) so a missing column is visible rather than silently absorbed. And check the totals: if the extracted rows do not add up to the printed total, something was dropped, and this single check catches most table extraction errors in one line of arithmetic.
Scanned documents and forms
For a stack of scanned forms, the reliable approach is dull and works. Straighten and crop the images first: free tools do this, and a skewed scan degrades recognition sharply. Recognise the text. Then have a model pull named fields from the recognised text rather than from the image.
For handwriting, expect variable results and check everything. Neat printing is often fine; joined-up writing, faint pencil, and forms filled in by many different people are not. There is no tool that solves this reliably today, and a product claiming otherwise should be tested on your worst example rather than your best one.
Which format to hand the model
Once you have the text, the format you send it in changes the answers. Markdown with headings preserved is markedly better than a wall of undifferentiated text, because the structure tells the model what is a section, a heading and a list. This is why the document-conversion tools that emit Markdown are worth the extra step.
For long documents, keep the page or section numbers in the text as you extract, so that when you ask for a quotation the model can give you a location you can check. A citation you cannot verify is worth much less than one you can, and putting the numbers in costs nothing at extraction time and is impossible to add afterwards.
The one to remember
The cheapest, fastest and most accurate route through a document is almost always the least fashionable one: use the text that is already in the file. Reach for recognition when there is no text, and for a vision model when the question is about what the page means rather than what it says.
Every lesson here is open. Your progress is recorded once you pass the AI at Work exam.
Check your understanding
A finance team extracts invoice tables with a vision model and some totals are wrong. What check would catch this reliably and cheaply?
Pick the one you would defend. Your answer stays private.
Stuck on something?Ask Rukmini, your AI tutor