PDF redaction is often confused with drawing a black rectangle. If that rectangle is an annotation, someone can remove it; if the original text layer remains, copying or extracting text may reveal the content. Permanent redaction must change the document’s underlying representation, not just its appearance on screen.
PlainPDF implements redaction in the browser by rebuilding every page as an image. This article explains the coordinate pipeline, sensitive-text detection, irreversible export and the cases that still require manual review.
Appearance is not removal
A normal PDF page can contain separate content streams, fonts, text positioning instructions, links and annotations. Covering a region in a viewer does not necessarily alter any of those objects. The viewer may simply draw a new rectangle above them.
That is why a screenshot of a covered page is not proof of redaction. The underlying text may remain searchable, extractable or accessible through another reader. A secure workflow needs an output that no longer contains the source content in a recoverable layer.
The PDF redaction tool therefore does not export the original page with annotations attached. It constructs a new document from rendered page images.
From a pointer gesture to PDF coordinates
The editor presents a scaled PDF page. When a user drags a box, pointer coordinates are relative to the displayed canvas. The rectangle is normalized against the canvas width and height, producing values between zero and one that survive responsive resizing.
PDF.js text items follow a different coordinate system. For automatic detection, the item transform and font measurements are used to calculate a bounding rectangle, then mapped into the same normalized space. Displayed marks and exported masks consequently share one representation.
At export, normalized rectangles are converted to pixels at the chosen render scale and painted black onto the canvas. Regression tests exercise these conversions separately from pointer input so layout changes do not silently move a mask.
What local automatic detection finds
Detection reads PDF.js text items directly on the device. It recognizes email addresses, international phone patterns and card-number candidates that pass the Luhn checksum. Matching within a line matters: an address may be embedded between labels or other words rather than isolated in a single text item.
The engine maps only the matched substring, not the entire line, to a suggested rectangle. Users see each suggestion as a reviewable box. They can undo the last mark on a page or clear that page without affecting other documents.
This is pattern detection, not a general-purpose named-entity recognition system. It does not understand every address, taxpayer identifier, medical term or person’s name.
Rasterization creates an irreversible boundary
Every source page is rendered to an image, and the boxes are burned into that image before a new PDF is assembled. The output has no original selectable text, links or bookmarks. There is no separate annotation to remove and no untouched source text layer beneath the black area.
The cost is substantial: all pages become rasterized, including those without marks. Text can no longer be selected, and file size may increase depending on page complexity and image settings. Users should retain the original separately if they still need an editable or accessible master.
Tests extract text from redacted outputs and verify that original strings are absent. That confirms the architectural removal path, but it does not replace visual inspection of the final page.
Review, batch behavior and safe sharing
Multiple documents keep independent page marks and export sequentially. A file without any mark cannot be exported accidentally through the redaction action. Results can be downloaded individually or packaged into a ZIP without sending the documents to a packaging service.
Before sharing, review every page, including headers, footers, margins and document properties. Scanned text may not be available as PDF.js text items at all. Unusual number formats and sensitive names need manually drawn boxes. Consider whether the image itself reveals handwriting, faces or surrounding context.
For workflows that also need rearranging or encryption, organize PDF pages before redaction and use password protection on the final document if appropriate. Redaction hides selected content; encryption controls access to the whole file. They solve different problems.