GroupDocs.Redaction for .NET features

Hide Sensitive Text in PDF Documents with Overlays Using .NET

Take control of PDF file content using C#. Use redactions to protect legal, financial, and personal information.

Protect business data in Pdf documents

GroupDocs.Redaction for .NET: built to help your .NET apps keep documents safe. Redact private info quickly and easily.

  1. Create a Redactor instance and provide the path to the Pdf file you want to redact.
  2. Configure redaction settings to get the result you need.
  3. Just set the text pattern to search for and pick the overlay color.
  4. Redact the document and save the changes.
// Hide sensitive text in PDF with overlay images

// Pass the file path to the Redactor constructor
using (Redactor redactor  = new Redactor("input.pdf"))
{
    // Set up the redaction options
    // Define the text pattern and overlay color
    var opt = new ReplacementOptions(System.Drawing.Color.Red);
    
    var redaction = new ExactPhraseRedaction("Text to hide", opt);

    // Redact and save the updated PDF file
    redactor.Apply(redaction);
    redactor.Save();
}
dotnet add package GroupDocs.Redaction
click to copy
copied
More examples Documentation

Redact content in documents

With GroupDocs.Redaction for .NET, you can remove or hide content across many file types. Protect sensitive information while keeping your documents easy to read and share.

Advanced Redaction Options

Edit text anywhere

Search and replace any matching text in your document to help secure confidential data.

Cover images

Place overlays over full images or selected areas to hide private visuals.

Handle metadata

Erase or change hidden metadata to prevent unwanted data leaks.

Use regular expressions to hide text

This example shows how to find and hide text using regular expressions

C#

//  Load the document you want to redact
using (Redactor redactor  = new Redactor("source.pdf"))
{
    // Define the redaction settings: text pattern and color
    var repl_opt = new ReplacementOptions(System.Drawing.Color.Blue);
    var redaction = new RegexRedaction("\\d{2}\\s*\\d{2}[^\\d]*\\d{6}", repl_opt);

    // Apply redaction to the content
    redactor.Apply(redaction);

    // Save the redacted version
    var save_opt = new SaveOptions() { AddSuffix = true, RasterizeToPDF = false };
    var outputPath = redactor.Save(save_opt);
}
dotnet add package GroupDocs.Redaction
click to copy
copied
More examples Documentation

About GroupDocs.Redaction for .NET

GroupDocs.Redaction for .NET gives C# developers the tools to hide or remove content from PDF files. It’s a simple way to keep documents safe. You can cover text, images, or metadata in many file types.
Learn more
About illustration

Ready to get started?

Download GroupDocs.Redaction for free or get a trial license for full access!

Useful resources

Explore documentation, code samples, and community support to enhance your experience.

Protect PDF Content with .NET Redactions

Use .NET to cover or erase content in PDF files. It’s a smart choice for keeping sensitive or official documents secure.

Temporary license tips

1
Sign up with your work email.
Free mail services are not allowed.
2
Use Get a temporary license button on the second step.
 English