Key Tools in GroupDocs.Redaction for Java

Protect DOCX Text with Overlays in Java

Quickly hide personal, legal, or business details in DOCX files with Java and GroupDocs.Redaction for Java.

Redact Sensitive Content in Docx

Easily clean documents in your Java project using GroupDocs.Redaction for Java.

  1. Initialize Redactor with your file.
  2. Choose how redaction should work.
  3. Select the text to hide and overlay color.
  4. Apply redaction and save the file.
// Cover text with overlays in DOCX

// Create a Redactor and load your document
final Redactor redactor = new Redactor("input.docx");
try
{
    // Choose redaction options
    // Pick text and color
    ReplacementOptions opt = new ReplacementOptions(java.awt.Color.RED);
    
    ExactPhraseRedaction redaction = new ExactPhraseRedaction("Text to hide", opt);

    // Save the redacted version
    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

Redaction Tools for Everyday Use

GroupDocs.Redaction for Java gives you simple options to hide sensitive details across documents while keeping them usable.

Easy redaction options

Find and change text

Hide or replace words in seconds.

Block parts of images

Mask sections of pictures or scanned content.

Erase background info

Remove hidden metadata like authorship or dates.

Find Text with Regex and Hide It

Use pattern matching to hide key phrases automatically

Java

//  Open the document you want to redact
final Redactor redactor = new Redactor("source.docx");
try
{
    // Set regex pattern and overlay style
    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 logic
    redactor.apply(redaction);

    // Save your cleaned document
    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

What GroupDocs.Redaction for Java Is

GroupDocs.Redaction for Java gives Java developers tools to clean up DOCX files. Redact names, numbers, or notes with ease.
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 DOCX Files Using Java

Protect sensitive content in DOCX by hiding or removing it using the tools in 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