Tips & Tricks

How to Redact Multi-Line Content From a PDF Without Leaving Detectable Text Fragments Between Redaction Zones

Redacting a single line of text from a PDF is straightforward. You draw a black rectangle over the text, and it disappears from view. Redacting text that wraps across multiple lines, or a paragraph that spans several lines with different lengths, is where the simple approach fails. If you place a single large rectangle over the entire multi-line block, you also cover adjacent text, white space, and possibly parts of neighboring paragraphs that should remain visible. If you place individual rectangles over each line, the gaps between lines, where the background color of the original document shows through, can reveal fragments of text, particularly the descenders of letters on the line above and the ascenders on the line below.

A 2025 investigation by a digital forensics firm found that in 12 percent of supposedly redacted PDFs published by government agencies, text fragments were recoverable from the narrow gaps between individual redaction rectangles (Forensic Focus, "Analysis of Redaction Failures in Public Records", 2025). The problem is not that the redaction tool malfunctioned. The problem is that the operator used a line-by-line redaction technique without understanding how text positioning works in PDFs and how gaps between redaction zones can preserve enough of each character for reconstruction.

How to Redact Multi-Line Content From a PDF Without Leaving Detectable Text Fragments Between Redaction Zones

How Text Positioning in PDFs Creates Redaction Gaps

PDF text is positioned using coordinates relative to the page. Each character or group of characters occupies a bounding box defined by its font metrics. The font ascender height, descender depth, and line spacing determine how much vertical space each line of text occupies. When you draw redaction rectangles by visually aligning them with the text on screen, there is a natural tendency to make the rectangle just tall enough to cover the visible characters. But the visible characters do not occupy the full vertical extent of the text line bounding box. The ascenders of tall letters like "h" and "l" extend above the typical character height, and the descenders of letters like "g" and "y" extend below the baseline. If your redaction rectangle is sized to cover the body of the text but not the full ascender and descender range, fragments of those extended strokes remain visible in the gap between redaction lines.

A second issue arises from PDF Redaction tools that mark redaction areas at screen resolution. The coordinates of a redaction rectangle drawn on a page displayed at 150 percent zoom may not align precisely with the underlying text coordinates when rendered at a different zoom level. A gap of even two or three pixels at 150 percent zoom translates to a gap of one or two pixels at 100 percent zoom, which is enough to preserve a recognizable fragment of a character.

WukongPDF

Try Redact PDF

No installation needed. Works directly in your browser.

Get Started โ†’

Redacting Multi-Line Content: The Correct Rectangle Placement

The safest approach for redacting a block of text that spans multiple lines is to use a single continuous redaction zone that covers the entire rectangular region from the top of the first line to the bottom of the last line, extending horizontally from the left edge of the leftmost character to the right edge of the rightmost character. This means covering the white space between the last word of one line and the right margin if the text is left-aligned, or covering the entire line width for justified text. The key principle is that the redaction zone must be continuous, without internal gaps, and must extend beyond the visible text on all four sides to account for ascenders, descenders, and any hidden text positioning offsets.

For paragraphs that contain line breaks within a sentence, where the text wraps naturally, the redaction zone should be a single rectangle spanning from the top of line 1 to the bottom of line N. For paragraphs where each line is a separate entry, such as a list or a table, individual rectangles per line are acceptable if and only if each rectangle extends at least 6 points beyond the visible text on all four sides and there is a clear non-text gap, such as a table border or a horizontal rule, between each line. If in doubt, use a single continuous zone.

Verifying That Redaction Zones Cover All Text Fragments

After applying redactions, the verification step is not optional. Open the redacted file and use the text selection tool to try to select text in the redacted areas. If any text can be selected, the underlying text stream was not removed and is still present in the file. Many redaction tools offer a "sanitize" or "remove hidden information" function after applying redactions. This step strips the underlying text content from the PDF for all redacted areas, making it unrecoverable. If your tool does not offer this, the redaction is a cosmetic overlay only, and the text can be recovered by anyone who opens the file in a text editor or a PDF structure viewer.

A second verification method is to export the redacted PDF as plain text. Any text that appears in the exported output for a redacted area indicates an incomplete redaction. The text stream for that area was not properly removed. Go back and reapply the redaction with the sanitize option enabled, or use a different tool that properly strips text content rather than just covering it visually.

Special Cases: Redacting Text in Tables, Columns, and Forms

Tables present a unique challenge because text in adjacent cells may sit very close together, and a redaction that covers one cell can bleed into the neighboring cell if the rectangle is too generous. The rule for tables is to redact entire cells rather than the text within cells. If a specific cell contains sensitive information, redact the entire cell area, including the cell borders, so that the table structure makes it clear that information was redacted from that cell. For narrow columns where redacting an entire column is not practical, extend the redaction rectangle to the column borders, using the column grid as a guide for precise placement.

PDF forms add another layer of complexity because form field data is stored separately from the visible page content. Redacting the visual text inside a form field does not remove the field value from the PDF internal data structures. Anyone who opens the file in a form-capable PDF viewer can still click on the field and see the original value. To redact form field data, you must flatten the form fields first, which converts the field values into regular page content, and then apply the redaction to the flattened content.

Common Redaction Mistakes and Their Consequences

The most damaging redaction mistake, and the one that has led to multiple public disclosure incidents, is using dark-colored rectangles drawn with the annotation tool instead of the dedicated redaction tool. Annotations are visual overlays. They can be moved, deleted, or made transparent by anyone who opens the PDF. The text underneath remains fully intact and fully searchable. Proper PDF Privacy protection requires removing the underlying data, not just hiding it from view. Always use the dedicated redaction tool, never the annotation or drawing tool, to apply redactions.

A second common mistake is redacting only the visible page content while leaving the metadata untouched. A PDF document properties may contain the original file name, author name, and creation date that reveal information the redaction was meant to hide. After redacting visible content, check the document properties and remove or sanitize any metadata fields that could contain sensitive information. WukongPDF provides a combined redaction workflow that processes both visible content and metadata in a single operation, reducing the risk of metadata-based information leaks.

Failing to account for the PDF incremental save history is a third significant mistake. PDF files that have been saved with incremental updates retain all previous versions of the page content. A redaction applied to the current version of a page will remove the text from that version, but the text may still be recoverable from the previous incremental saves stored in the file. The solution is to save the redacted document using a full save, not an incremental save, which consolidates all changes and discards the revision history.

Automated Redaction for Multi-Line Patterns

When the same type of information needs to be redacted across many pages or many documents, such as social security numbers, email addresses, or phone numbers, manual rectangle placement becomes impractical and error-prone. Pattern-based automated redaction uses regular expressions to identify the text strings to be redacted and automatically draws redaction zones over every occurrence. The advantage is completeness: a properly written pattern catches every instance, including those the operator might miss during a manual review. The disadvantage is that a poorly written pattern generates false positives, redacting text that should remain visible.

To use pattern-based redaction safely, first run the pattern in preview mode if your tool supports it, which highlights matches without applying redactions. Review a sample of the matches to verify that the pattern is catching the intended content and nothing else. Adjust the pattern as needed, preview again, and then apply the redaction to the full document. After applying, run the text export verification to confirm that no unintended content was removed alongside the target content.

WukongPDF

Try Redact PDF

No installation needed. Works directly in your browser.

Get Started โ†’