Worked example: PDF intake, or checking the text against the page

← All guides·Worked example

Before any text pulled out of a PDF is trusted, it is compared with a picture of the page. This page shows the routine from Guides 3 and 4 running as a skill on a made-up bundle: what it does, what it catches, and a prompt you can copy.

This is the conversion step in the matter folder (Guide 2), done properly. It answers the problem described in Guide 3: OCR does not tell you what it could not read.

What the skill does

For every PDF that comes into a matter, the pdf-intake skill:

  • checks each page for the usual trouble, and flags the risky pages;
  • pulls the text out with the right method for that kind of PDF;
  • turns every page into a picture and keeps those pictures on file;
  • has Claude compare the text with the picture of each flagged page, and repair or flag what does not match;
  • writes a note at the top of the text file saying how far it can be trusted.

The rule behind it: statistics about the text (how many characters on a page, how many are real letters) tell you there is a lot of text. They do not tell you the text is right. Wrong reading order, sideways text turned into nonsense, table headings mixed into the figures, a 0 read as an O, handwriting turned into plausible rubbish: all of these passed the statistics in testing in August 2026. Only a look at the page catches them.

Step 1 — Find the risky pages

Intake report for a made-up 40-page bundle. Green pages are trusted as they are. Everything else gets a look.
Intake report for a made-up 40-page bundle. Green pages are trusted as they are. Everything else gets a look.

A short script looks at every page and flags: sideways or upside-down text; tables; several columns or panels; pages that are mostly pictures; pages with no text layer at all; and identifiers that are easy to misread (0 and O, 1 and I, 5 and S). A page with a flag is not trusted until it has been checked against its picture.

Step 2 — Pull the text out with the right method

  • A clean, typed PDF (a judgment from SAFLII, a pleading from the court file): the text layer is read directly. Fast and exact.
  • A scan of printed text: OCR, page by page, with an open-source engine.
  • A short scan, five pages or so: Claude reads the pictures. It is often quicker and better than OCR.
  • Handwriting: Claude reads the picture first. OCR is only a cross-check, never the answer. (In testing, OCR read “QX-91B” as “QX-91LB”: a plausible mistake, which is the worst kind.)
  • A heavy watermark: see Step 4.

Commercial tools do this work too. Adobe Acrobat Pro will OCR a large bundle quickly and is a reasonable first pass on a scanned record. Paid document-parsing services handle difficult layouts, such as an annual report where graphs and text must stay together, at a cost that is hard to justify for everyday use. Whatever produces the text, Step 3 still applies.

Step 3 — The check against the page

A made-up forensic report. The OCR text skipped paragraph 7.3, the one under the watermark. The picture of the page did not.
A made-up forensic report. The OCR text skipped paragraph 7.3, the one under the watermark. The picture of the page did not.

This is the step that matters. Claude opens the picture of each flagged page next to the text, and compares them. Where they differ, the page is re-read from the picture, and the difference is recorded. Anything Claude still cannot read is marked [?] in the text and listed. In a legal matter that list is a to-confirm list: someone looks at the original.

The pictures stay in a folder next to the text (report_pages/). Later work, such as a citation check or a question about a page, can open the picture instead of trusting the text.

Step 4 — Watermarks

Before and after. The watermark is gone. The text is rough, which is why it is still checked against the page.
Before and after. The watermark is gone. The text is rough, which is why it is still checked against the page.

Watermarks such as COPY, DRAFT or PRIVILEGED are printed light. So the page is redrawn in stark black and white: the light grey drops out and the dark text stays. Then the text is read again. The result is not pretty, and it still goes through Step 3. For a short document Claude simply reads the picture instead.

A prompt you can copy

Use it in Claude Cowork with the matter folder connected. Replace the words in square brackets.

Run PDF intake on every PDF in [folder]. For each file: flag risky pages (rotated text, tables, columns, image-heavy, no text layer, easily confused characters); extract the text with the right method; save a picture of every page and keep them; compare the text of every flagged page against its picture and re-read it from the picture where they differ; mark anything you cannot read as [?]. Put a note at the top of each text file saying which pages were checked by eye and what is still uncertain. Give me one table: file, pages, flagged pages, pages re-read, [?] count. Do not delete or change the original PDFs.

Limits

  • It is only as good as the check in Step 3. If the check is skipped to save time, you are back to trusting OCR.
  • Handwriting stays hard. The picture check narrows the doubt; it does not remove it. Doubtful words go to the legibility check.
  • It costs time. Looking at pages is slower than trusting text. On a large record the picture check is done on the flagged pages, not every page.
  • Confidentiality. Everything runs on the files in your own folder, but Claude still reads them, on the provider’s servers. Guide 10 comes first.

Building it yourself

Guide 4 walks through writing this skill with Claude’s help, installing it and testing it. The version described here adds one script for the page flags; the routine is the same.