That black box in your PDF is probably not a redaction: how to check in one command
You get a PDF back from legal, HR or a client portal. The account numbers are covered with neat black boxes, so it looks safe to forward. Very often it is not. A black rectangle drawn on a page is just another shape on top of the text. The words underneath are still in the file, and anyone can get them back with copy and paste, a text extractor, or a search box. Here is how to check a PDF in a…
A PDF file from legal, HR, or a client may contain black boxes obscuring account numbers or other sensitive information. However, these black rectangles are simply shapes on top of the text, so the underlying words are still present in the file. Anyone can reveal them using copy and paste, a text extractor, or the search function.
To verify a redaction, use the command-line tool pdftotext with Poppler installed. Replace the term you expect to have been redacted (e.g., "4111") in the command: pdftotext redacted.pdf - | grep -i "4111". If the term reappears, the redaction merely concealed the text, not removed it. Desktop browsers also have a built-in function to search for words, which can be used to check if the redaction was successful.
For coders, a Node.js script using pdfjs-dist can scan every page of a PDF and alert if the targeted term persists, even in hidden metadata, comments, annotations, form fields, bookmarks, links, attachments, or scanned documents. A true redaction must erase the content and any remnants of it from all parts of the file. Then, a quick one-command test should return no results.
If the redaction check fails, do not distribute the file. The KovaPDF Redact PDF tool, available at https://www.kovapdf.com/redact-pdf, redacts files by removing text, image pixels, OCR layers, comments, form values, document properties, attachments, and bookmarks, while also alerting if any hidden instances of the redacted term remain.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.