GroupDocs.Redaction for .NET features

Cover Text in DOCX with Overlays Using .NET

Hide sensitive content in your DOCX documents using C# code. Great for legal, business, or personal document protection.

Remove private data from Docx documents

GroupDocs.Redaction for .NET helps .NET developers clean up documents in just a few lines of code.

  1. Create a Redactor and provide your file path.
  2. Define how the redaction should work.
  3. Enter text to hide and choose the overlay color.
  4. Redact the file and save it.
// Hide text in DOCX using overlay blocks

// Create a Redactor and load the file
using (Redactor redactor  = new Redactor("input.docx"))
{
    // Set your redaction preferences
    // Enter the text and set block color
    var opt = new ReplacementOptions(System.Drawing.Color.Red);
    
    var redaction = new ExactPhraseRedaction("Text to hide", opt);

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

More ways to clean up documents

With GroupDocs.Redaction for .NET, redact different file types to keep your content safe and professional.

Smart redaction built in

Edit or remove text

Find specific phrases and hide or replace them.

Hide image areas

Cover sensitive spots in pictures or scanned pages.

Wipe hidden metadata

Delete invisible info that may expose user or system data.

Regex for redacting content

See how regular expressions can find and hide sensitive words

C#

//  Open the target file
using (Redactor redactor  = new Redactor("source.docx"))
{
    // Set 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 logic
    redactor.Apply(redaction);

    // Export the redacted document
    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

What is GroupDocs.Redaction for .NET?

GroupDocs.Redaction for .NET helps C# developers hide or erase private content in DOCX files. Use it to block out text, images, and metadata in different file formats.
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.

Hide Content in DOCX with .NET

Protect sensitive data in DOCX documents by covering it with overlays or removing it completely using .NET tools.

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