GroupDocs.Redaction

Remove sensitive text, metadata, and annotations from documents — with a single, consistent API across .NET, Java, Node.js, and Python.

4 platforms 40+ formats Latest v26.11.0

Choose your platform selecting one updates the snippets below

.NETv26.10.0
dotnet add package GroupDocs.Redaction
Javav26.11.0
com.groupdocs:groupdocs-redaction
Node.jsv26.11.0
npm install @groupdocs/groupdocs.redaction
Python via .NETv26.11.0
pip install groupdocs-redaction-net

Getting started with .NET

using System;
using GroupDocs.Redaction;
using GroupDocs.Redaction.Redactions;

// Pass the input file to a Redactor instance
using (Redactor redactor = new Redactor("source.pdf"))
{
    // Configure the redaction options
    var repl_opt = new ReplacementOptions("[redacted]");
    var red = new ExactPhraseRedaction("Data", repl_opt);

    // Run the redaction process
    RedactorChangeLog result = redactor.Apply(red);

    // Save the redacted file
    if (result.Status != RedactionStatus.Failed)
    {
        redactor.Save();
    }
}
import com.groupdocs.redaction.*;
import com.groupdocs.redaction.redactions.*;

// Load your source file with a Redactor instance
final Redactor redactor = new Redactor("sample.pdf");
try
{
    // Define the redaction criteria and settings
    ReplacementOptions ro = new ReplacementOptions("[redacted]");
    ExactPhraseRedaction red = new ExactPhraseRedaction("Data", ro);

    // Execute the redaction operation
    RedactorChangeLog result = redactor.apply(red);

    // Save the file with redactions applied
    redactor.save();
}
finally { redactor.close(); }
const groupdocs = require('@groupdocs/groupdocs.redaction');

// Load your source file with a Redactor instance
const redactor = new groupdocs.Redactor("sample.pdf");

// Define the redaction criteria and settings
const replOpt = new groupdocs.ReplacementOptions("[redacted]");
const red = new groupdocs.ExactPhraseRedaction("Data", replOpt);

// Execute the redaction operation
const result = redactor.apply(red);

// Save the file with redactions applied
redactor.save();
redactor.close();
from groupdocs.redaction import Redactor
from groupdocs.redaction.redactions import ExactPhraseRedaction, ReplacementOptions

# Adjust the redaction parameters
repl_opt = ReplacementOptions("[redacted]")
red = ExactPhraseRedaction("Emily Johnson", repl_opt)

# Load your file into the Redactor instance
with Redactor("sample.pdf") as redactor:

    # Start the redaction process
    result = redactor.apply(red)

    # Export the cleaned file
    result_path = redactor.save()

Popular classes & namespaces

Key capabilities

  • Redact text by phrase or regex
  • Remove metadata & annotations
  • Image-area redaction
  • Text in images through OCR
  • Rasterize output
  • Batch redaction
  • Across PDF, Office & images

Supported formats

PDFWordExcelPowerPointOpenDocumentImages

...and more document, image and text formats.

Resources