Key Tools Inside GroupDocs.Redaction for Java

Clean Up Metadata in DOCX Documents Using Java

Remove unwanted metadata from your DOCX files with Java. Keep your files private and secure for sharing or storage.

Erase Hidden Info from Docx Files

GroupDocs.Redaction makes it easy to delete metadata in your Java apps.

  1. Initialize Redactor and load the Docx file.
  2. Set the tool to remove specific metadata fields.
  3. Apply redaction to delete the hidden info.
  4. Save the updated file.
// Delete metadata from DOCX files

// Open file with Redactor
final Redactor redactor = new Redactor("input.docx");
try
{
    // Choose which metadata to remove
    EraseMetadataRedaction redaction = new EraseMetadataRedaction(MetadataFilters.All);

    // Apply and save changes
    RedactorChangeLog result = 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

Protect Sensitive Data in Documents

GroupDocs.Redaction for Java lets you hide private content from all types of files. Make sure no hidden data gets shared.

Metadata, Text, and Image Redaction Tools

Text Redaction

Find and delete sensitive text across your document.

Image Overlays

Cover up parts of images to hide private visuals.

Metadata Cleaning

Remove background metadata that may reveal hidden info.

How to Remove Metadata

This example shows how to delete hidden properties like Author and Title from a DOCX file.

Java

//  Open your DOCX document
final Redactor redactor = new Redactor("source.docx");
try
{
    // Select the Author field to clean
    MetadataSearchRedaction redactionAuthor = 
        new MetadataSearchRedaction("[A-Za-z0-9 ]+", "GroupDocs Company");
    redactionAuthor.setFilter(MetadataFilters.Author);

    // Select the Title field to clean
    MetadataSearchRedaction redactionTitle = 
        new MetadataSearchRedaction("[A-Za-z0-9 ]+", "GroupDocs.Redaction Usage");
    redactionTitle.setFilter(MetadataFilters.Title);

    // Run the redaction
    Redaction[] redactions = new Redaction[]
    {
        redactionAuthor, redactionTitle
    };
    redactor.apply(redactions);

    // Save the final file
    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 is GroupDocs.Redaction for Java?

GroupDocs.Redaction helps Java developers remove private content from DOCX files. Easily redact text, images, and 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.

Clean Metadata from DOCX with Java

Use Java to remove hidden metadata from DOCX documents. Great for privacy and data protection.

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