DEV Community

ShamsPDF
ShamsPDF

Posted on

Your black box isn't hiding anything: why most PDF redactions fail

You draw a black box over a name, an account number or a passport number. You save the PDF and send it. It looks safe.

Often it isn't. In many cases the text is still in the file, just covered. Anyone can select it, copy it, or search for it.

Why it happens

A PDF is built in layers. The text sits in the page content. When you draw a rectangle with a "shape", "highlight" or "comment" tool, the PDF just adds a new layer on top. The text underneath is untouched.

That's fine for reading on screen. It's useless for hiding information.

A 10-second test

Open your "redacted" PDF and try any of these:

  1. Select and copy: drag over the black box, press Ctrl+C, paste into Notepad.
  2. Search: press Ctrl+F and type a word you hid.
  3. Extract the text: run the file through any PDF to Text tool.
  4. Move the box: open it in a PDF editor and try to drag or delete the rectangle.

If any of these shows the hidden words, the redaction failed.

We tried this on a test file with black boxes over a name and an account number. A PDF to Text run still printed both, in plain text.

Other places data hides

Even with the visible text gone, a PDF can still leak:

  • Metadata: author name, original title, software used
  • Earlier versions: some editors append changes instead of rewriting the file, so old content can remain inside
  • Comments, form fields and hidden layers
  • OCR text on scans: a scanned page can have an invisible text layer. A box over the image doesn't remove that text

How to redact properly

Real redaction removes the text and the image pixels underneath, then saves a new file.

  1. Use a real redaction tool, not a drawing tool. In Adobe Acrobat Pro it's the Redact tool, and you must apply it. A free option is ShamsPDF Redact: it removes what's under each box. This one runs on a server, and the file is deleted right after download.
  2. Run the 10-second test again on the new file.
  3. Remove metadata and hidden data before sharing.
  4. When it really matters, print to a fresh PDF or export the pages as images, then check once more.

Quick checklist

  • [ ] Used a redaction tool, not a shape or highlight
  • [ ] Copy, search and PDF-to-Text show nothing
  • [ ] Metadata and comments removed
  • [ ] Shared the new file, not the original

Have you ever received a "redacted" PDF where the text was still there? I'd like to hear the stories in the comments.

Top comments (0)