GroupDocs.Redaction for Java Features

Hide Confidential Images in PDF Files with Overlays Using Java

Protect personal and business data in PDF files with Java. Our tools make image redaction simple and effective.

Protect Business Information in Pdf Files

GroupDocs.Redaction for Java helps your Java applications secure documents. Redact private images in a few easy steps.

  1. Initialize a Redactor and set the path to your Pdf file.
  2. Choose redaction settings for best results.
  3. Pick the image area and pick an overlay color.
  4. Process and save the secured file.
// Cover sensitive images in PDF

// Load the file with Redactor
final Redactor redactor = new Redactor("input.pdf");
try
{
    // Set overlay color and dimensions
    java.awt.Dimension replacement_size = new java.awt.Dimension(100, 100);
    RegionReplacementOptions replacement_options = 
        new RegionReplacementOptions(java.awt.Color.BLUE, replacement_size);

    // Select the target area for redaction
    java.awt.Point replacement_point = new java.awt.Point(200, 200);
    ImageAreaRedaction redaction = 
        new ImageAreaRedaction(replacement_point, replacement_options);

    // Apply the overlay and save the file
    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

Hide Content in Documents

With GroupDocs.Redaction for Java, you can hide or delete sensitive data in various file formats. Protect private information while keeping files easy to read and distribute.

Powerful Redaction Options

Modify Text Anywhere

Find and replace sensitive words across your document to secure private content.

Hide Images

Add overlays to images or parts of them to keep sensitive visuals hidden.

Clean Up Metadata

Delete or edit hidden metadata to prevent unintended information leaks.

Cover Image Data with Overlays

This example demonstrates how to hide confidential visuals in documents using overlays.

Java

//  Open the document for editing
final Redactor redactor = new Redactor("source.pdf");
try
{
    // Define overlay size, color, and position
    java.awt.Dimension replacement_size = new java.awt.Dimension(300, 30);
    RegionReplacementOptions replacement_options = 
      new RegionReplacementOptions(java.awt.Color.BLUE, replacement_size);
    java.awt.Point replacement_point = new java.awt.Point(20, 125);
    ImageAreaRedaction redaction = new ImageAreaRedaction(replacement_point, replacement_options);

    // Choose the image area to redact on page one
    redaction.setFilters(new RedactionFilter[] {
        new PageRangeFilter(PageSeekOrigin.Begin, 0, 1),
        new PageAreaFilter(new java.awt.Point(0, 300), new java.awt.Dimension(600, 600))
    });

    // Add the overlay to cover sensitive data
    redactor.apply(redaction);

    // Save the updated document
    SaveOptions save_options = new SaveOptions();
    save_options.setAddSuffix(true);
    save_options.setRasterizeToPDF(false);
    redactor.save(save_options);
}
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

About GroupDocs.Redaction for Java

GroupDocs.Redaction for Java offers Java developers effective tools to hide or erase content in PDF files. Cover text, images, and metadata to keep your documents safe across multiple formats.
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.

Protect PDF Files with Java Redactions

Use Java to hide or remove sensitive data in PDF files. Ideal for securing official and private documents.

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