Addaly is in open beta. Things will change, and AI answers can be wrong — check anything that matters.

AI at Work

The tasks it genuinely helps with, the ones it quietly ruins, and the line you must never cross.

Lesson 42 of 739 min

PDFs, scans and the black rectangle that hides nothing

The first thing to find out about any PDF

Open it and try to select a sentence with your mouse.

If the text highlights, it is a born-digital PDF — the characters are really in the file, and they can be extracted exactly, by a tool, with no model and therefore no possibility of invention.

If nothing highlights, it is a scan: a photograph of a page wearing a PDF wrapper. There is no text in it at all. Anything you get out of it came from recognition, and recognition makes mistakes.

Two seconds, and it determines everything else you do. Enormous amounts of wasted effort — and a good number of wrong figures — come from people running a scanned invoice through a language model when the same invoice arrived by email as a born-digital file the week before.

Exact beats clever

For a born-digital PDF, use extraction, not intelligence:

bash
pdftotext -layout invoice.pdf invoice.txt

pdftotext is part of poppler-utils, free on every platform. The -layout flag preserves the spatial arrangement, which is what keeps table columns roughly aligned. What comes out is exactly what is in the file: no paraphrase, no rounding, no helpful correction.

Then, if you want, hand the extracted text to a model for structuring. You have separated the two jobs — getting the characters, and understanding them — and only the second one can hallucinate.

When it is a scan

Run OCR, and prefer a dedicated OCR engine over a vision model for anything numeric.

bash
ocrmypdf scan.pdf searchable.pdf

ocrmypdf wraps Tesseract, is free, works offline, and adds a text layer to the original. Tesseract handles over 100 languages, including scripts a general vision model handles unevenly.

The reason to prefer it for numbers is the failure mode. Tesseract, on a poor scan, produces 1O42 — obviously broken, and you go and look at the original. A vision model produces 1042, cleanly, whether or not that is what the page says. Ugly and honest beats clean and possibly wrong, every time, for a figure that goes into an account.

Tables are the hard case

PDF has no concept of a table. A table in a PDF is lines and text positioned on a page, and the row-and-column structure exists only in your eye.

So extraction of tables is genuinely difficult and everything struggles. pdftotext -layout gets you close for simple tables. Tabula is free, has a graphical interface, and was built specifically for pulling tables out of PDFs into CSV — for anyone regularly extracting financial tables it is the right tool. camelot does the same from Python.

Whatever you use, validate arithmetically. If the table has 40 line items and a stated total, sum the 40 and compare. That single check verifies the entire extraction for free, and it is available far more often than people notice: invoices, payroll, budgets, stock counts, expense claims and results tables nearly all carry a total that has to reconcile.

Forms

PDF forms come in two kinds. A live form has real fields that can be read and filled programmatically — pdftk or qpdf will list them. A flattened form has had the fields burned into the page and is functionally a scan.

If you are producing forms for other people to fill in, keep them live. If you are processing forms other people filled in by hand, you are doing handwriting recognition, with all the digit confusions covered earlier, and every figure needs checking against the original.

Redaction is not a black rectangle

This one has embarrassed governments, courts and law firms repeatedly, and it is still happening.

Drawing a black box over text in a PDF adds a black box. The text is still in the file, underneath, and can be recovered by selecting and copying, or by running pdftotext. The same applies to white boxes, to highlighting in a viewer, and to "hiding" a layer.

Proper redaction removes the underlying content. Use a tool with a genuine redaction function that deletes the text, or take the crude reliable route: export the page to an image, black out the region in GIMP, and rebuild the PDF from the image. Then open the result and run pdftotext on it to confirm the words are gone. That final check takes ten seconds and is the only thing that actually proves it.

PDFs also carry metadata — author, software, sometimes the original file name and path, which can itself disclose a client's name. exiftool shows it and qpdf or mat2 can strip it.

The whole free stack

poppler-utils for extraction, ocrmypdf and Tesseract for scans, Tabula for tables, qpdf for splitting, merging and metadata, LibreOffice Draw for editing a PDF's contents directly, and exiftool for what is hiding in the file properties.

All free, all offline, all deterministic. For document work that must not leave your machine, this stack does more of the job than any AI feature — and the AI is best used afterwards, on text you extracted exactly.

The one thing to keep

Try to select the text first: a born-digital PDF can be extracted exactly with no model involved, a scan needs OCR whose errors look like errors — and a black box drawn over text leaves the text in the file.

Before you move on

Why prefer Tesseract over a vision model for reading figures off a poor-quality scanned invoice?

Pick the one you would defend. Nobody sees your answer.

No ads. No data sale. No public scores on people. Ever.

© 2026 Addaly

PDFs, scans and the black rectangle that hides nothing · AI at Work · Addaly