A black rectangle drawn over an account number looks like a redaction. In most PDF tools it is a shape sitting on top of the page, and the number is still underneath it as text. Select the line and copy it, or search the file, and it comes straight back. Forms are where this hurts: a direct-deposit form, a tenancy application, a scanned ID someone typed into.
The PDF Editor in the osFoundry desktop app removes the text itself instead of covering it. The example below is a one-page direct-deposit form (Example: the name, account and phone number are made up for the demo). The form prints the account number twice, once to confirm it, and the employee's name appears twice too, in the name field and again on the signature line.
Find every place the text appears
Open the PDF in the PDF Editor, click All tools, then Redact a PDF. The panel lists the redaction tools. Click Find text and redact.
In the dialog, pick Multiple words or phrases and type each thing to remove on its own line: the name, the account number, the phone number. The counter under the box confirms "3 word(s) or phrase(s)". Click Mark all.
The search runs on the page's real text, the same text that copy and paste would give you, so it finds the copies you might miss by eye. On this form it marks five places: the account number twice, the name twice, and the phone number once. The panel at the bottom left says "5 marks", and each one shows as a thin red outline on the page.
The same dialog has a Patterns option (phone numbers, for example) for when you don't know the exact values in advance. It also says plainly that text inside images isn't found until it has been recognised with OCR, which matters for scanned pages.
Apply the marks
Click Redact all, then Apply in the confirmation. Each red outline turns into a solid black box, and a message confirms "Applied 5 redaction marks. Save to remove the content from the file."
This is where the editor does something different from a drawn rectangle. Apply deletes the characters under each mark from the page's content and paints the black box where they were. The rest of the line doesn't shift: the words around a removed number keep their exact position. Read back afterwards, the page had 75 words of text before and 63 after. The 12 missing words are exactly the two names, two account numbers and one phone number.
Sanitize, then save
The page is clean now, but the file can still carry the name somewhere else. This form had the employee's name stored as the document's author in its properties, the way Word and most export tools fill it in.
Back in the Redact a PDF panel, click Sanitize document. The dialog lists what it removes: metadata, file attachments, comments, form fields (flattened), hidden text and layers, bookmarks, links, actions and scripts, and private application data.
Click Sanitize, then save. As the dialog says, saving rewrites the whole file so nothing removed stays in it. That detail matters: many PDF tools save changes by appending to the end of the file, which leaves the earlier version readable inside it.
Check the saved file yourself
Open the saved copy in any PDF reader and search for the account number. In this example the search finds zero matches, and the same is true for the name and the phone number. Its document properties no longer show an author. Copying the black-boxed line gives you the label and nothing after it.
Two habits are worth keeping. Redact a copy and keep the original, because the removal can't be undone. And search for each value after saving, not before, since the saved file is the one that gets sent.
The PDF Editor runs on your own computer, so the form never has to be uploaded to a website to be cleaned; the approach is described on the page about osFoundry's private, local-first design. The desktop app is free from the osFoundry download page for macOS, Windows and Linux.




Top comments (0)