To redact a PDF properly, you remove the text from the file, not just cover it. Mark what must go, apply the redaction so the words are taken out of the page (with any hidden text layer under it), clean out comments and metadata, and then test the result: select a redacted area, copy it and paste it into a text editor. If nothing comes out, the redaction held.

The rest of this guide explains each step, where it usually goes wrong, and how DeclassifAI handles it.

Why a black box is not redaction

A PDF is not a picture of a page. It is a set of instructions: draw these words in this font at this position, draw this rectangle here. When you draw a black rectangle over a name with a drawing or comment tool, you add one more instruction on top. The instruction that draws the name is still there.

That is why "redacted" documents keep leaking. The text can be selected and copied out from under the box, found with the search function, read by a text extractor, or revealed when the box is moved or the file is opened in a different program. The film below shows the copy-and-paste test on a document like that.

Film · The black bar · 1:08 · muted until you turn the sound on, pausableMore films on declassifai.com

Printing a document, blacking it out with a marker and scanning it again does remove the text, but it is slow, it loses the searchable text of everything else, and a thin marker can still be read against the light.

Step by step: redacting a PDF

1. Work on a copy

Keep the original unchanged and redact a copy. You need the original to check the result against, and you may have to produce a different version for a different recipient. Decide who will get the copy: what you remove depends on who reads it and what they already know (more on that in our guide to GDPR and document redaction).

2. Find everything that identifies someone

Names are the obvious part. The rest is easy to miss:

  • national identity numbers (in Norway, fødselsnummer and D-numbers), bank account numbers, case and customer numbers;
  • e-mail addresses, phone numbers and street addresses;
  • signatures, handwritten notes and stamps;
  • faces and number plates in pictures inside the document;
  • details that identify a person without naming them, such as a job title in a small workplace or a rare diagnosis with a date and a place.

Search the document for each name and number you find, because the same person usually appears more than once, sometimes in a different form ("Kari Nordmann", "K. Nordmann", "Ms Nordmann").

3. Apply redactions that remove the text

Use a tool that deletes the marked text from the page content, not one that draws a shape. In a proper redaction tool, marking and applying are two separate steps: you mark, you review, and only when you apply is the text removed. Check that the tool also removes the text layer that a scanned and text-recognised PDF has under the picture of the page.

4. Clean what is not on the page

Personal data hides outside the visible page:

  • comments, sticky notes and other annotations;
  • document properties such as author, title and subject;
  • bookmarks and form fields that repeat names from the text;
  • embedded files and attachments;
  • links that point to a person's profile or a case system.

5. Test the result before you send it

Open the redacted copy, not the working file, and run three checks:

  1. Copy and paste. Select each redacted area, copy it and paste it into a plain text editor. Nothing should come out.
  2. Search. Search for a few of the names and numbers you redacted. There should be no hits.
  3. Properties. Open the document properties and check that no author name or other personal detail is left.

If the document was scanned, also check that the picture itself is covered where the text was, and not only the text layer.

Scanned PDFs need text recognition first

In a scanned PDF the words are part of an image. A tool cannot find a name it cannot read, so the scan has to be read with text recognition (OCR) first. The boxes then have to follow the actual lines of text, which is harder on tilted or poor scans. After redaction, check the scan by eye: automated reading of a poor scan can miss words.

How DeclassifAI does it

DeclassifAI was built for exactly this job. In short:[2]

  • It finds, you decide. DeclassifAI marks 59 kinds of personal information, Norwegian ID numbers included, using pattern rules and models we have trained or fine-tuned ourselves. Every mark is a suggestion: you keep it, leave it out or add your own, and nothing is redacted until you press Redact.
  • Removed, not covered. The text is taken out of the file, with the hidden text layer and the metadata. Select a redaction and paste it elsewhere: nothing comes out.
  • Hidden content is cleaned. For PDFs, annotations and comments, links, embedded files and document metadata are removed, and personal data in bookmarks and form fields is redacted.[1]
  • Scans are read. Scanned PDFs are read with text recognition, and boxes follow the text lines, also on tilted scans.
  • Checked before download. After redaction, the document is read back and searched for Norwegian national identity numbers, Norwegian bank account numbers, e-mail addresses and Norwegian phone numbers. If one is still there, or the check cannot be completed, the file is not returned.[1]

That check is a safety net, not a guarantee. It does not look for names, addresses or health information, so a person still reviews every file before it is shared. The Security page lists what the check covers and what it does not.

Files are processed on servers in Norway, in Microsoft Azure's Norway East region. Documents are not saved to a database or file storage, photos and video are deleted automatically on a fixed schedule, and files are never used to train models.

A short checklist

Before you send a redacted PDF:

  • I redacted a copy, and the original is kept apart.
  • I searched for every name and number, in every form it appears.
  • The redaction removed the text; it did not draw a box.
  • Comments, metadata, bookmarks, form fields and attachments are clean.
  • Copy and paste from a redacted area gives nothing.
  • A search for a redacted name gives no hits.

For a public sector body answering a request for access, see also our guide to redacting documents for an innsynskrav.

Questions

Questions and answers

Is a black box over text in a PDF enough to redact it?
No. A box drawn on top hides the text from view, but the text usually stays in the file. Anyone can select it, copy it and paste it elsewhere, or open the file in another reader or a text extractor. Proper redaction removes the text itself from the file.
How can I check that a PDF is really redacted?
Open the redacted copy, select the area where a redaction is, copy it and paste it into a plain text editor. If anything comes out, the text is still in the file. Also search the document for a redacted name, and look at the document properties for author names and other metadata.
What else should I remove besides the visible text?
Comments and annotations, document metadata such as author fields, bookmarks and form fields that repeat the same names, embedded files, and links. In a scanned PDF the text is in the picture, so the scan has to be read with text recognition before it can be redacted.
Can I redact a Word document the same way?
The principle is the same: the text has to be removed, not covered. Word files also carry author fields, comments, tracked changes and pictures that can hold personal data, so they need the same cleaning.
Does DeclassifAI keep my PDF?
DeclassifAI processes documents on servers in Norway, in Microsoft Azure's Norway East region. Documents, PDFs included, are not saved to a database or file storage, and files are never used to train models.