Skip to content
gl.tools

Is a black box over a PDF a redaction?

A rectangle drawn over a line deletes nothing: the text is still underneath and can be copied out. Why that happens, how to check it in twenty seconds, and what actually works.

No. It looks like one, and that is exactly the problem.

If you want to hide a line in a PDF, you reach for the rectangle tool, drag a black box over the spot and save. On screen the line is gone. In the file it is not. You can select it, copy it and paste it into a note, and there is the account number again that seemed covered a moment ago.

This is not a rare edge case or a beginner's mistake. It has happened to government offices, law firms and newsrooms, and it keeps happening, because nothing in the interface says a word when you save. Nobody gets a warning.

Why the text stays

A PDF is not an image file. It is a list of instructions that a viewer carries out one after another. Greatly simplified, a page says something like this:

InstructionWhat it does
Font Helvetica, 11 pointset in this from here on
Move to position 72, 650the pen travels
Show "IBAN DE12 3456 7890"the text enters the document
Fill the rectangle 70,640 to 300,665 in blackan area is painted

The viewer works through the list from top to bottom. The filled area comes last, so it sits on top of the text. But the line carrying the text is still in the list, unchanged, complete, as a string. The rectangle did not delete it, it merely stood in front of it.

Every program that extracts text from a PDF walks the same list and picks out the strings. It does not care what was painted on top, because it is not painting, it is reading. That is precisely why copying works.

The check takes twenty seconds

You need nothing installed and no particular skill:

  1. Open the finished PDF in any viewer.
  2. Drag the mouse across the black box as if you were selecting text.
  3. Press Ctrl+C.
  4. Paste it into an editor or an email.

If text comes out, it was not a redaction. If nothing comes out, the spot really is empty. This check belongs before every handover, whatever program made the file. It is quick, and it is the only thing that genuinely tells you anything.

One caveat: the fact that you cannot drag a selection proves nothing. Some viewers refuse to select over a filled area even though the text is underneath. To be sure, open the file in a second program or use its search: if searching for part of the hidden line finds a hit, the line is still there.

What actually works

For the text to disappear, the spot has to stop being text. There are essentially two ways.

Remove the text section from the instruction list. That is the clean route, but it is trickier than it sounds. Text in a PDF is rarely stored as a whole sentence in one place; it is broken into pieces that are positioned individually, often word by word or even character by character, and the characters may be mapped to other characters through a table of their own. Cut out the wrong thing here and the layout of the rest of the page falls apart.

Turn the page into an image, with the box baked in. Then there are no strings left on that page for anyone to read out, because there is no text at all any more, only pixels. Whatever lay under the box never became visible while the image was being drawn and appears in no instruction.

That second route is the one our redact PDF tool takes, and it takes it page by page: only the pages that actually carry a box are rasterised. All the others stay untouched and keep their text. Making a whole document unreadable because one line on page 3 has to go would be the worse trade.

The price, and saying it out loud

A rasterised page is an image. That has three consequences, and they belong in the open:

  • The text on that page is no longer searchable and cannot be selected.
  • The file gets bigger. For a three-page document with two rasterised pages we measured 146 kilobytes.
  • Resolution decides legibility. That is why our tool takes the resolution of the original by default instead of using a fixed value. A document scanned at 300 dpi would otherwise lose a third of its sharpness, although all that was asked for was a redaction.

A tool that names only the benefit and keeps quiet about the price is exactly the kind of advertising this text is arguing against.

Looking, not claiming

The most important decision in our tool is not the rasterising. It is the step afterwards.

Once the new file is built, it is opened again and its text content is read out, exactly the way somebody trying to break the redaction would do it. The result appears above the download button. If the check fails, the tool says so and advises against the result instead of quietly handing out a file.

We measured this independently of the tool itself, with a separate program outside the browser. Test document: an IBAN on three pages, boxes on pages 1 and 3.

Pagecharacters readable beforeafter
1 (with a box)1910
2 (no box)251251
3 (with a box)2510

Page 2 keeps its text in full; the two redacted pages give up nothing at all.

What else is sitting in the file

The text under the box is the best-known case, but not the only one. The document properties often hold the author's name, the program used and the full file path, something like C:\Users\Surname\Contracts. Redact a document to take out a name, and you hand it over this way regardless.

Our tool therefore deliberately does not carry those properties into the new file. That is not a side effect of rasterising, it is a decision of its own.

The whole thing in two sentences

A black rectangle is a drawing, not a deletion. Check every redacted file before you pass it on, by dragging across the spot and pasting, and do not rely on what you can see.

Redact PDFBars over confidential passages – and the text underneath is genuinely gone.

All articles