Redaction must remove content, not merely draw a black rectangle over visible text. The browser route plans case-insensitive literal matches, rewrites the document, and verifies concrete marker variants before offering the result.
Redact from .NET
using OfficeIMO.Pdf;
PdfDocument source = PdfDocument.Open("case-file.pdf");
var search = new PdfRedactionSearchOptions { MatchCase = false };
search.AddLiteral("Account 1234");
PdfRedactionPlan plan = source.Redactions.Search(search);
PdfDocument redacted = source.Redactions.Apply(plan);
var verify = new PdfRedactionVerificationOptions { MatchCase = false };
verify.RequireRemovedText("Account 1234");
PdfRedactionVerificationReport report = redacted.Redactions.Verify(verify);
report.ThrowIfFailed();
File.WriteAllBytes("case-file.redacted.pdf", redacted.ToBytes());
The verification report checks extracted text, raw PDF bytes, encoded strings, and decoded streams according to the selected markers. Keep the plan and report when the redaction decision must be auditable.
Important limits
Literal search depends on readable PDF text. It does not discover text embedded only in scanned images, infer sensitive entities, or replace human review of surrounding context. OCR-assisted and pattern-based policies should remain separate, explicit workflows.