The Madlanga Commission

OCR for Legal Documents: Make Scanned Records Searchable

How OCR works on legal documents, how to run it on scanned PDFs, where it fails, and how to check the text before you cite it, with South African examples.

Published 2026-10-25

OCR for Legal Documents: Make Scanned Records Searchable

Legal document positioned on a scanner platen

OCR (optical character recognition) turns a picture of a page into text a computer can search, copy and index. For legal documents, that means a scanned affidavit, a court order or an exhibit bundle stops being a stack of images and becomes something you can search for a name, a date or a case number. The process is simple to run. The hard part is trusting the output, because OCR makes mistakes on exactly the pages lawyers, journalists and researchers care about: stamps, handwriting, poor photocopies and dense tables.

This guide covers what OCR does, how to apply it to a scanned PDF, what goes wrong, how to check the text before you rely on it, and what South African privacy and records rules mean for your workflow.

Madlanga Commission
Explore the Commission’s Public Record
Searchable records can make complex proceedings easier to navigate; explore the Madlanga Commission’s public record of hearings, testimonies and case files.

TL;DR

Table of Contents

A scanner or a phone camera produces an image. To a computer, an image of the word “Madlanga” is just a grid of pixels, so a keyword search finds nothing. OCR software analyses those pixels, recognises letters, numbers and other characters, and writes them out as text. South African legal-technology publisher Lextrado describes OCR as recognising characters in flattened images and converting scanned paper documents or image-only PDFs into searchable electronic text.

It is worth being modest about what that means. A University of Cape Town research source describes OCR as a computer’s reading ability, and notes that it still performs below human reading. That one sentence is a good rule for everything below: OCR is fast and tireless, but it is not a careful reader.

In legal discovery, OCR can process paper documents, TIFF images and flattened PDFs, according to the same Lextrado explanation. In practice that covers most of what you meet in a South African matter or inquiry:

A PDF can look like text and still be an image. A quick test: open it and try to select a single word with your cursor, or press the search shortcut and type a word you can see on the page. If nothing is found or you can only select the whole page, the file needs OCR.

Why it matters for public records

Scale is where OCR stops being a convenience and becomes a precondition for access. OpenUp, a South African civic-technology organisation, reported in May 2022 that the Zondo Commission’s material included 1 petabyte of data and 8,655,530 pages of documentary evidence, and explained that image-based PDFs must pass through OCR to become machine-readable and searchable. Its argument is that digitising a record is not the same as making it public in any useful sense: if pages stay image-only, nobody can search them. Searchable text, and the extraction of names and organisations from it, is what makes a huge record navigable.

Government bodies reach the same conclusion when they buy digitisation. A tender published on 30 April 2026 for the Government Communication and Information System’s paper records lists high-resolution scanning, OCR processing, metadata tagging and quality assurance as separate steps. Notice that quality assurance is listed on its own line. It is not assumed to happen by itself.

Four steps in records digitisation

The tool matters less than the sequence. Whether you use desktop software, a built-in PDF feature or a document-processing service, the same stages apply.

  1. Start from the best scan you can get. Scan at a resolution high enough for small print, keep pages straight, and avoid shadows and curled edges. If you have the original paper, rescan it rather than OCR a poor photocopy of a photocopy.
  2. Clean up the images. Image-processing steps such as de-skewing (straightening a tilted page) and binarization (converting to clean black and white) can help clarify PDFs and improve OCR results.
  3. Set the language. South African documents often mix English with Afrikaans, and sometimes isiZulu or Sesotho names and phrases. If your tool lets you choose recognition languages, pick every one that appears. A wrong language setting turns correct words into nonsense.
  4. Output a searchable PDF, not just a text file. A searchable PDF places an invisible text layer over the original images, which preserves notes, marks and signatures. That is the format you want for legal work, because the page you read is the page that was filed.
  5. Spot-check immediately. Search for three or four words you can see on the page. If they are not found, or found in the wrong place, rerun with better settings before you process a whole bundle.
  6. Keep the original. Never overwrite the source scan with the OCR version. Store both and label them.

Searchable PDF or extracted text?

A searchable PDF is best for reading, citing and sharing, because the image stays visible. Plain extracted text is better for analysis, such as counting how often a name appears or loading hundreds of pages into a database. Many workflows need both, with the PDF as the record and the text as the working layer.

If accessibility matters, for example when publishing a document for screen-reader users, OCR is only the first step. Guidance from the State of Colorado’s technology office on accessible PDFs says that making scans machine-readable with OCR must be followed by manually reviewing tags and reading order. That is a US source, but the point about manual review holds anywhere.

Where OCR goes wrong on court and inquiry documents

The best South African evidence on accuracy comes from a 2019 University of Cape Town thesis on automating data capture in the Deeds Registry. Its OCR pipeline reached an overall accuracy of 89.6%, and 98.3% for typed text characters, but results were significantly worse for handwritten and stamped information.

Read those two numbers together. Clean typed text is nearly perfect. Yet the overall figure of 89.6% means roughly one character in ten was wrong across the whole document set, and the errors concentrated in the places where legal documents carry their weight: signatures, initials, date stamps, commissioner of oaths stamps and handwritten amendments. That was a study of title deeds, so treat the figures as an illustration of the pattern, not a promise for your own files.

The usual trouble spots

The practical consequence: a search that returns no hit does not prove a word is absent. It may mean the OCR misread it. Search for variants, partial names and neighbouring words before you conclude anything.

Check the text before you rely on it or cite it

The Deeds Registry thesis concludes that OCR can streamline processing, but that a secondary quality check remains necessary to ensure accurate inputs and the validity of the documents. The same logic applies to anyone quoting a legal record. A short verification routine:

  1. Check every quotation against the page image. Open the original page and read the passage with your own eyes. Never quote from the text layer alone.
  2. Verify the high-risk items twice. Names, case numbers, amounts, dates, section numbers and paragraph references are where one wrong character changes the meaning.
  3. Confirm the document’s identity. Check the title, date, court or commission, and version. A draft, an amended order and a final ruling may sit in the same folder.
  4. Cite the original, not your copy. Reference the document as issued, with the page or paragraph number from the source, and keep your OCR file as a finding aid.
  5. Note what you could not read. If a stamp or handwritten note was illegible, say so in your working notes rather than guessing.

For teams, assign a second person to the check on anything going into a pleading, an article or a report. The cost is small next to a published misquote.

Many general AI assistants can read an uploaded PDF or an image of a page and return text, and they are tempting because they also summarise. Two cautions apply, and both come from how legal work is done rather than from the technology itself.

First, accuracy. An AI-produced transcription is still a machine reading, and it can silently smooth over a word it cannot read, which is worse than a visible gap. Second, trust and duty. South African legal-research guidance from LawLibrary treats AI output as a lead, not legal authority: users should check the primary document, context, date, status and connected authorities, while accounting for confidentiality, personal-information risks, professional duties and organisational policies.

In plain terms: do not upload a client’s privileged file, or a document containing identifiable personal details, to a tool whose data handling you have not checked. If you do use AI to help read a page, compare the result with the original and cite the original.

Can ChatGPT or another AI tool OCR a legal PDF? — overview diagram

Privacy, confidentiality and access in South Africa

Legal files are full of personal information: identity numbers, addresses, medical details, the names of witnesses and complainants. Running them through OCR does not change their status, but it does multiply the copies and make them easy to search, so think about the rules first.

The Protection of Personal Information Act (POPIA) is the main one. The South African Police Service’s own POPIA manual summarises the core ideas: personal information may be processed on a listed lawful basis, collected for a specific, defined purpose, and protected by security and confidentiality obligations when shared with third parties, with access also subject to the Promotion of Access to Information Act (PAIA). The same manual notes that POPIA does not apply to purely personal or household activity, to certain public-body national-security and crime-related functions with adequate safeguards, or to the judicial functions of a court.

What this means for you depends on who you are:

This is general information, not legal advice. For a specific matter involving sensitive personal information, ask an attorney or your organisation’s information officer.

Store, organise and cite your OCR files

A searchable archive is only useful if you can find things in it a year from now. Good habits cost little.

Our perspective: searchable is not the same as understandable

We run an archive of the Madlanga Commission’s proceedings, and the lesson we take from that work is that OCR is the start of access, not the end. A page that can be searched is still a page that someone has to place in context: which witness, which hearing day, which exhibit, which ruling.

That is why we organise material around cross-references rather than file lists. A reader who searches a name should land on the witness profile, the hearing days where that person testified, the exhibits they spoke to and any related rulings, without having to follow the live proceedings. The same text, once linked to its context, answers questions that a folder of searchable PDFs cannot.

We would also give one piece of advice to anyone building their own collection: keep a visible line between the record and your interpretation. The record is the page as issued. Everything else, including your OCR text, your notes and your summaries, is a layer on top that should always lead the reader back to the page. If you want to see how we apply that, our guide to judicial commissions in South Africa shows how records are structured, and our article on searchable archives and state capture explains why this matters for accountability.

— Meriol Lainchyon

Skip the OCR work for the Madlanga Commission record

If your interest is the Madlanga Commission, you do not need to scan or OCR anything yourself. The archive brings together daily hearing records, case files, witness profiles, exhibits, rulings, statements and media briefings in one searchable place, free to use. Start from a witness profile such as Bheki Cele or Dr Ntandazo Sifolo, or begin at the Madlanga Commission archive and search by name, topic or document. Journalists may also find our guide to searching the records for data journalism useful, and our explainer on getting transcripts quickly covers access routes.

For your own documents, the earlier sections give you a workable method. Where our archive stops, your own OCR, verification and filing habits take over.

FAQ

How do you OCR a PDF document?

Open the scanned PDF in software that offers a text-recognition or OCR function, choose the document language, and export a searchable PDF. Clean, straight, high-resolution scans give better results, so fix the image first if you can. Afterwards, search for a few visible words to confirm the text layer works.

For clean typed pages, usually very accurate: a 2019 UCT study of South African title deeds measured 98.3% for typed characters. Handwriting, stamps and poor scans are much weaker. Always check names, numbers and quotations against the original page.

Can ChatGPT OCR a PDF?

General AI assistants can often read text from an uploaded PDF or image, but the output can contain silent errors. Legal-research guidance recommends treating AI output as a lead and checking the primary document. Avoid uploading confidential or personal information to tools whose data handling you have not checked.

What is the difference between a scanned PDF and a searchable PDF?

A scanned PDF is only a picture of each page, so you cannot search or copy its words. A searchable PDF has the same image with an invisible text layer added by OCR, so you can search and select text while the page looks unchanged.

Sources