What GroupDocs.Redaction for Java Can Do

Overlay Redaction in WORD Files with Java

Hide important details in your WORD documents using color overlays powered by Java and GroupDocs.Redaction for Java.

Protect Private Info in Word Format

GroupDocs.Redaction for Java gives Java developers quick ways to clean up files and secure their content.

  1. Start a Redactor and load the Word file.
  2. Choose your redaction options.
  3. Add text pattern and overlay color.
  4. Run the redaction and save the file.
// Hide text using overlays in WORD

// Use Redactor to open the document
final Redactor redactor = new Redactor("input.docx");
try
{
    // Set redaction preferences
    // Add keywords and select color
    ReplacementOptions opt = new ReplacementOptions(java.awt.Color.RED);
    
    ExactPhraseRedaction redaction = new ExactPhraseRedaction("Text to hide", opt);

    // Apply and save your redacted file
    redactor.apply(redaction);
    redactor.save();
}
finally { redactor.close(); }
<dependencies> <dependency> <groupId>com.groupdocs</groupId> <artifactId>groupdocs-redaction</artifactId> <version>24.6</version> </dependency> </dependencies> <repositories> <repository> <id>repository.groupdocs.com</id> <name>GroupDocs Repository</name> <url>https://repository.groupdocs.com/repo/</url> </repository> </repositories>
click to copy
copied
More examples Documentation

More Redaction Capabilities

Use GroupDocs.Redaction for Java to remove both visible and hidden content from files while keeping layout intact.

Simple, clean output

Replace text

Cover words or terms that shouldn’t be seen.

Mask visuals

Use colored overlays to hide images or parts of them.

Erase metadata

Remove details hidden in file properties.

Regex-Powered Redaction

Learn how to use regex to automatically hide specific content

Java

//  Load the document to redact
final Redactor redactor = new Redactor("source.docx");
try
{
    // Define your regex pattern and overlay color
    ReplacementOptions repl_opt = new ReplacementOptions(java.awt.Color.BLUE);
    RegexRedaction redaction = new RegexRedaction("\\d{2}\\s*\\d{2}[^\\d]*\\d{6}", repl_opt);
    
    // Apply the redaction
    redactor.apply(redaction);

    // Save your clean version
    SaveOptions saveOptions = new SaveOptions();
    saveOptions.setAddSuffix(true);
    saveOptions.setRasterizeToPDF(false);
    redactor.save(saveOptions);
}
finally { redactor.close(); }
<dependencies> <dependency> <groupId>com.groupdocs</groupId> <artifactId>groupdocs-redaction</artifactId> <version>24.6</version> </dependency> </dependencies> <repositories> <repository> <id>repository.groupdocs.com</id> <name>GroupDocs Repository</name> <url>https://repository.groupdocs.com/repo/</url> </repository> </repositories>
click to copy
copied
More examples Documentation

Meet GroupDocs.Redaction for Java

GroupDocs.Redaction for Java gives Java users full control over WORD redaction. Hide anything you want—text, visuals, or metadata.
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.

Redact Content in WORD with Java

Keep your WORD documents private by hiding or removing sensitive data using Java.

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