Nyxiontech PDF Tools › Redact PDF
How to check a PDF redaction really removed the text
A redacted PDF can look perfect and still contain everything you meant to hide. The black boxes are on the screen and on paper, but the text underneath may still be in the file, where anyone who receives it can copy it out. This guide shows how to test a redacted PDF in a few minutes, with tools you already have, and how our Redact PDF tool removes the text.
Why a black box is often not a redaction
A PDF page is built from layers: the page text, drawings, images, comments (annotations), form fields and document properties. A black rectangle drawn in a word processor before exporting, a shape or comment added in a PDF app, or an annotation in a preview app is just one more object placed on top of the text. It hides the text from view, but the text is still part of the page.
That text can be selected and copied, found with search, pulled out by any converter, or revealed by moving or deleting the rectangle in an editor. White text, white-out boxes and text recoloured to black have the same problem. Information also lives outside the page content: in comments, form field values, the document properties (author, title) and the file name.
A real redaction removes the text from the file. You cannot tell the two apart by looking, so test the file.
Five checks for a redacted PDF
Always test the file you are about to send, not the original. Do every check: each one catches something the others miss.
- Copy and paste. Open the file, select everything on the page (Ctrl+A or Cmd+A) and paste it into a plain text editor. Then drag a selection over just the blacked-out area and paste again. If the hidden words appear, they were only covered. If everything you paste comes out as nonsense rather than just the hidden part, this check cannot tell you anything until you deal with that: see why PDF text pastes as gibberish.
- Search. Press Ctrl+F (Cmd+F) and search for part of each thing you removed: a surname, the last digits of an account number, a street name. Numbers are written in many ways, so try them with spaces, with dashes and without.
- Extract the text with pdftotext. pdftotext, part of Poppler (
poppler-utilson most Linux systems,popplerin Homebrew on a Mac), prints all the text on the pages, including text hidden under boxes or drawn in white. If the commands below find nothing, that part is clean. - Comments, form fields and properties. Open the comments panel and look through any form fields: copy-paste and pdftotext do not show their contents. Check the document properties in your viewer, or run
pdfinfo, for the author, title and subject. - The file name and the rest of the package. "contract_John_Smith.pdf" gives away what the boxes hide. Rename the file, and check any other attachments sent with it.
pdftotext redacted.pdf - | grep -i "smith"
pdftotext redacted.pdf - | grep -E "[0-9]{6,}"
pdfinfo redacted.pdf
The second command lists every run of six or more digits, which is a quick way to spot account, phone or ID numbers you forgot about.
What a pass looks like
- Copying the redacted area gives nothing, or only the text around it.
- Searching for each removed item finds nothing.
- pdftotext output does not contain the removed items.
- No comment, form field or property still holds them, and the file name is neutral.
To see the whole answer at once instead of checking one item at a time, Compare PDFs will diff the original against the redacted file and list every line of text that disappeared. A page that was redacted properly loses its entire text layer, because the page is re-rendered as an image, so a page that reports only a few removed lines is a page the redaction did not reach. How to compare two PDFs covers reading the result.
If any check fails, go back to the original, redact again with a tool that removes the content, and test the new file. Do not try to fix the leaking file by drawing more boxes on it.
How the Redact PDF tool does it
Redact PDF runs in your browser, on your device, so the file is never uploaded. This is what it does:
- You mark what to hide by typing text, by ready patterns (e-mail addresses, phone numbers, bank account numbers and IBANs, Polish NIP and PESEL numbers) or by dragging boxes on the page. The preview shows every box; click one to remove it.
- Every page with at least one box is re-rendered as an image (at 200 dpi) with the black boxes burnt in. The original text, comments and form fields of that page are not in the output.
- Pages without boxes are copied as they are, with selectable text. Only comments and form field values that contain the searched text, or match the chosen patterns, are removed from them.
- Document properties such as author and title are not carried over to the new file.
Limits to know about
- Redacted pages become images, so their remaining text can no longer be selected or searched, and the file may get bigger. If you need searchable text, run the result through OCR.
- Search works on the text layer. A scan without OCR has none, so draw the boxes by hand. The same goes for signatures, stamps and photos.
- A phrase that the PDF stores in several separate pieces may not be found by search. Look through the preview of every page.
- Patterns match common formats: the phone pattern also catches other long numbers, and an unusually written number can be missed. Boxes are deliberately a little wider than the text.
- The output keeps the original file name with
_redactedadded. Rename it if the name itself is sensitive.
Whichever tool you use, run the five checks on the result before you send it.