Skip to main content

20% off your first year with code See plans

Guide · How-to guide · Scans

How to anonymise a scanned PDF: OCR, zones and review

Anonimatum Team

In short

A scanned PDF is an image: without OCR there is no text in which to find names or ID numbers. Recognise the text first, detect the data, cover signatures and stamps with zones, then check both the image and the text layer.

Many documents you need to anonymise were never digital: letters received by post, contracts signed in ink, old medical reports, files digitised for archiving or for a subject access request. Once scanned, they become PDFs full of page photographs. A person can read the National Insurance number; a pattern search cannot.

This guide covers how to handle them: what OCR is and why it comes first, what makes recognition fail, how to cover what is not text (signatures, stamps, handwritten notes) and how to make sure nothing survives in either the image or the hidden text layer.

Step by step

  1. Check whether the PDF has text

    Try selecting a word and searching with Ctrl+F. No text means a pure scan; text that searches badly suggests a poor earlier OCR.

  2. Improve the scan if you can

    If you still have the paper, rescan it straight and at sufficient resolution. A good source saves recognition errors later.

  3. Enable anonymisation with OCR

    Upload the PDF to Anonimatum and turn on the OCR option in the settings. Confirm the pages that need OCR; native pages are not reprocessed.

  4. Choose patterns and AI options

    Tick patterns such as email, phone or bank details, add a custom pattern for NI numbers or SSNs, and select the AI categories you need.

  5. Draw zones over non-text content

    Cover signatures, stamps, handwritten notes and photos with zones, and save them as a figure pattern if they repeat.

  6. Preview and correct

    Run the preview and review the yellow marks; add data that OCR misread and untick false positives.

  7. Apply and verify

    Apply the anonymisation, download the result and check both image and text layer by zooming, copying and searching.

What makes a scanned PDF different

A PDF exported from a word processor stores text as characters. A scanned PDF stores one image per page. There is a third, very common and treacherous variant: a scan that the scanner or some software has already OCR’d, adding invisible text behind the image so it can be searched. If you only draw a black box over the image, the name disappears from view but remains in the text layer; if you only delete the text, the name is still visible in the picture.

So anonymising a scan means dealing with the image pixels and the recognised text at the same time. It is the same principle as genuine document redaction, applied to a page that happens to be a photograph.

OCR first: no text, no detection

Optical character recognition (OCR) turns the image into positioned text. Only then can patterns find a National Insurance number (QQ 12 34 56 C, specimen format) or a US Social Security number (123-45-6789, fictitious), and only then can AI recognise names, addresses or dates. Without OCR, the only option is to cover data zone by zone by hand, which is unworkable in an 80-page bundle.

What affects OCR quality

  • Resolution: very low-resolution scans confuse letters; around 300 dpi is the usual recommendation for text.
  • Skew and edges: crooked pages, binding shadows or fingers in phone photos degrade recognition.
  • Contrast and marks: copies of copies, faded thermal paper or stamps over text.
  • Typography and tables: tiny print, narrow columns or forms with boxes.
  • Handwriting: OCR for printed text does not read it reliably; treat it as an image.

OCR errors have a direct consequence: if a 0 is read as an O or a character goes missing, the pattern does not match and the data slips through. That is why, with scans, human review of the preview matters even more than with a native PDF.

Signatures, stamps and handwriting: use zones

Some personal data is not text at all: a handwritten signature, a received stamp bearing an officer’s name, a note scribbled in the margin, a photocopy of a passport attached to the file. For these you use zones — rectangles drawn on the page that remove whatever lies inside. In Anonimatum you draw the rectangle and choose its scope: the current page, a range of pages or the whole document.

If the same element always sits in the same place — a stamp repeated down the side of every contract page, a signature at the foot of a standard form — save the zone as a figure pattern and reuse it. Version 1.9.0 also ships system templates for typical cases, such as contracts with side signature stamps.

How to do it in Anonimatum

When you upload a PDF that already has a usable text layer, OCR is not applied again. For a scan, you enable the anonymise-with-OCR option in the settings: the app tells you which pages need OCR and asks for confirmation first. You choose the OCR engine (Tesseract by default, or PaddleOCR) in your profile. The scanned PDF anonymiser page gives an overview.

Quota usage with selective OCR
DocumentPages with OCRQuota pages
10 pages, all native010
10 pages, 3 scanned313
10 pages, all scanned1020

As the table shows, OCR pages count double, but only the pages that actually need it. If you simply want a searchable PDF without anonymising it, use the searchable PDF tool, which runs in the document queue.

Verifying an anonymised scan

Checks specific to scans

  • Zoom into every page: boxes must fully cover the data, including signature strokes that stray outside.
  • Select all text, copy it and paste into an editor: no redacted data should appear in the OCR layer.
  • Search with Ctrl+F for the surname and for misread variants (for example with 0 instead of O).
  • Check margins, reverse sides and blank pages: received stamps and notes often hide there.
  • Review metadata and the file name before sharing.

Frequently asked questions

Why can’t the tool find the ID number in my scanned PDF?

Because without OCR there is no text to search. Turn OCR on. If it is already on, check the quality: one misread character is enough for a pattern to miss.

How much quota does a scanned PDF use?

Pages that receive OCR count double: a 10-page document with OCR on 3 pages uses 13 pages of quota, not 20.

Are handwritten signatures detected automatically?

Do not rely on it. Signatures, stamps and handwriting should be covered with drawn zones or reusable figure patterns.

My scan already had OCR. Is there a risk?

Yes: the invisible text layer may hold the data even if you cover it in the image. Use a tool that removes both and verify by copying the output text.

Turn scanned bundles into clean, shareable PDFs

See the plans and start anonymising scans with selective OCR, EU-hosted AI detection and zones for signatures and stamps.

Sources and legislation

  1. ICO, Anonymisation guidance (UK GDPR)
  2. Data Protection Act 2018, legislation.gov.uk
  3. Regulation (EU) 2016/679 (GDPR), recital 26