Skip to content
PageSaver

Why a Black Box Doesn't Redact a PDF (and How to Check)

In January 2019, Paul Manafort's lawyers filed a PDF response to Robert Mueller with several passages blacked out. It didn't stay hidden. A Guardian reporter found that copying the blacked-out text and pasting it into another document made the redacted sentences appear. In December 2025 it happened again: some documents from a civil suit against Jeffrey Epstein's estate gave up their blacked-out text the same way, and The New York Times read a passage about a check one of the executors signed. The Justice Department said those redactions had been applied by parties in the litigation.

Neither case needed any hacking. PDF redaction fails this way because a black box drawn on a PDF hides text from your eyes and nothing else. The text is still in the file, and anything that reads the file can read it. This post explains why, walks through the four ways redaction usually goes wrong, and shows how to check a PDF before you send it.

What a PDF page actually stores

A PDF page is not a picture. It's a list of drawing instructions, run in order from top to bottom: set a font, place this string at these coordinates, fill this shape. Text and shapes are separate instructions, and a shape drawn later just paints over the pixels of whatever came before.

To make that concrete, here's a small test file built with pdf-lib: two lines of text, then a black rectangle over the second line.

import { PDFDocument, StandardFonts, rgb } from 'pdf-lib';

const doc = await PDFDocument.create();
const page = doc.addPage([400, 130]);
const font = await doc.embedFont(StandardFonts.Helvetica);
page.drawText('Account holder: Jane Example', { x: 40, y: 85, size: 14, font });
page.drawText('SSN: 123-45-6789', { x: 40, y: 55, size: 14, font });
// The "redaction": a black box over the SSN line.
page.drawRectangle({ x: 36, y: 49, width: 160, height: 22, color: rgb(0, 0, 0) });

Opened in a viewer, it looks redacted:

A PDF page showing "Account holder: Jane Example" with a solid black bar where the second line should be

Now ask the macOS PDF engine for the page's text, which is what copy and paste or search does:

Account holder: Jane Example
SSN: 123-45-6789

The reason is right there in the page's content stream (trimmed a little):

BT
/Helvetica-9742682568 14 Tf
1 0 0 1 40 55 Tm
<53534E3A203132332D34352D36373839> Tj
ET
q
0 0 0 rg
1 0 0 1 36 49 cm
0 0 m 0 22 l 160 22 l 160 0 l h f
Q

The Tj line draws the string. The hex is just "SSN: 123-45-6789" byte by byte. The second block fills a 160 × 22 black rectangle over the same spot. Nothing in the file connects the two. The rectangle doesn't delete the text under it any more than a sticky note deletes the words on a printed page.

Four ways PDF redaction fails

1. The box is drawn on top

This is the demo above, and it's how the ABA Judges' Journal explained the Manafort filing: the text only appeared to be hidden by black rectangles. Someone draws black rectangles in a PDF editor, or adds black highlighting in Word, then exports a PDF. Every character is still there for copy and paste, search, screen readers and text extraction tools.

A variation is a black box added as an annotation (a square or rectangle comment) instead of page content. Annotations are separate objects that sit on top of the page, so anyone can select the box in a viewer and delete or move it.

2. The redaction was marked but never applied

Dedicated redaction tools usually split the job into two steps. Nutrient's documentation describes it well: first you create redaction annotations over the areas to remove, which "won't remove any content from the document yet; it just marks regions for redaction." Only when you apply them is the content actually removed.

It's easy to mark everything, save, and send the file without the second step. At that point the text is all still in the page, and the redaction marks are just more annotations, so the file leaks everything.

3. An earlier version is still in the file

PDFs support incremental updates: instead of rewriting the file, an editor can append the changes to the end and leave the original content as it was (Foxit's developer docs explain the mechanism). Saving is fast that way.

For redaction it's a trap. If the redacted version was saved as an update, the unredacted original can still be sitting earlier in the same file, and recovering it is a matter of cutting the file at the right place. Every incremental save adds another end-of-file marker, %%EOF, so a file that has been saved this way more than once has more than one.

4. The gap gives the text away

Even when the text really is removed, the layout around it can leak it. The black bar tells you roughly how long the missing text was. In 2023, researchers at the University of Illinois went much further. Their paper, Story Beyond the Eye: Glyph Positions Break PDF Text Redaction, examined 11 popular PDF redaction tools, including Adobe Acrobat, and found they leak information about the redacted text. The positions of the characters left around the box are stored precisely, and in the paper's words "subpixel-sized horizontal shifts in redacted and non-redacted characters can be recovered." With a proportional font, where every letter has its own width, a precise measurement can narrow a list of candidate names or numbers down to very few. The authors' code is public.

This one matters most for short, guessable values: names, dates, amounts, ID numbers.

How to check if a PDF is properly redacted

Before sending a redacted PDF, a few minutes of checks catch the first three failures:

  1. Press Ctrl+A (Cmd+A on a Mac) on each redacted page, copy, and paste into a plain text editor. If the hidden words show up, the redaction failed.
  2. Search the PDF for a word or number you know was redacted.
  3. Click on each black box. If you can select, move or delete it, it's an annotation, not redaction.
  4. Count the %%EOF markers, for example with grep -a -c '%%EOF' file.pdf. More than one means the file was saved incrementally. A file saved for "fast web view" (linearized) legitimately has two, so treat two as a reason to look closer, not proof.

These checks are slow across a 200-page file, so we automated them in PixelPDF's redaction audit, a free redaction checker that runs in the browser. It collects three kinds of evidence.

Pixels. It renders each page, annotations included, and then checks every character in the text layer against the rendered image. Visible text always contrasts with its background. A character whose cell is a single flat colour can't be seen, but it can still be copied. Our rule: a character counts as hidden when at least 97% of the pixels in its cell are within 14 brightness levels (out of 255) of the cell's median. If that median is dark (below 90), it's reported as covered, which is the classic failed black box. If it's light, it's reported as invisible text.

That second category needs a person to look at it, because invisible text is sometimes deliberate. OCR software makes scanned PDFs searchable by laying the recognised words over the scan in an invisible text rendering mode. Tesseract's PDF renderer does exactly that, with a comment that reads "use invisible ink". The PDF format can't tell an OCR layer apart from a hidden secret, so the audit reports invisible text and lets you decide.

Structure. It lists redaction annotations that were marked but never applied, and dark filled square, circle or polygon annotations that any viewer can delete.

File history. It counts the %%EOF markers, discounting the extra one in a linearized file, to tell you whether earlier versions are stored in the file.

How to redact a PDF properly

There are two ways to do it properly, and both have a cost.

Remove the content under the box. This is what applying a redaction does in a proper redaction tool: the text, image and drawing instructions inside the marked area are deleted from the page, and a black box is drawn in their place. The rest of the page stays real text, so it remains selectable and searchable. The weakness is the one from the research above: the characters around the gap keep their exact positions.

Turn the redacted pages into images. Render the page to pixels, paint the boxes into the pixels, and replace the page with the image. Nothing of the original survives on that page: no text, no glyph positions, no hidden layers. The cost is that the page is no longer text, so it can't be searched or copied (OCR can bring that back later) and the file gets bigger.

PixelPDF's Smart Redact takes the second route, because a slightly worse page is a better outcome than a leak. It renders each redacted page at up to 4× scale, capped at 60 megapixels per page and drawn in 2048-pixel tiles so large pages don't exhaust browser memory. It paints the black boxes into the image with a few pixels of padding, and swaps the page for the image. Only the pages with redactions are converted. The output is a new PDF built from scratch: the converted pages are fresh pages holding just the image, the other pages are copied across one by one and keep their text, and nothing from the original file's earlier versions or document properties comes along. Then it checks its own work: it reopens the exported file and confirms the converted pages have no extractable text left. If any text survives, the export fails rather than handing you a file that only looks safe.

Whichever method you use, finish the same way. Make sure the result is written as a full new file, not saved as an update on top of the original, and count the %%EOF markers to confirm no earlier version came along. Check the document properties and bookmarks too, since a redacted name can easily survive in a title or an outline entry. Then run the copy-and-paste test one more time on the final file, because that's the one that gets sent.