Features of GroupDocs.Redaction for .NET

Mask Text in XLSX Files Using Overlays and .NET

Use C# and GroupDocs.Redaction for .NET to add simple overlays that block sensitive text in your XLSX files.

Keep sensitive info safe in Xlsx documents

GroupDocs.Redaction for .NET helps .NET developers protect files. Hide private content with just a few lines of code.

  1. Create a new Redactor object with your Xlsx file path.
  2. Adjust redaction settings as needed.
  3. Add a search pattern and pick a color for the overlay block.
  4. Run the redaction and save your file.
// Cover private text in XLSX using overlays

// Load the file with Redactor
using (Redactor redactor  = new Redactor("input.xslx"))
{
    // Choose how redaction will work
    // Enter text to hide and select overlay color
    var opt = new ReplacementOptions(System.Drawing.Color.Red);
    
    var redaction = new ExactPhraseRedaction("Text to hide", opt);

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

Smart redaction features

Use GroupDocs.Redaction for .NET to erase or hide content in various file types. Keep private details away from public view.

Practical redaction tools

Change any text

Search and update any string in the document to protect data.

Hide image content

Add squares or rectangles to cover sensitive parts of pictures.

Clean up metadata

Remove or overwrite background file details before sharing.

Match and hide with regex

Learn how to detect and redact content using regular expressions

C#

//  Open the target document
using (Redactor redactor  = new Redactor("source.xslx"))
{
    // Set up pattern and overlay 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 rules
    redactor.Apply(redaction);

    // Export 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

How GroupDocs.Redaction for .NET Helps

GroupDocs.Redaction for .NET lets developers using C# hide unwanted content in XLSX files. Block out anything—from words to pictures—across different 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.

Use .NET to Hide Info in XLSX Files

Add overlays or remove parts of your XLSX documents to protect sensitive details with help from .NET.

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