GroupDocs.Redaction for Java API lets developers remove sensitive data from popular file formats like Microsoft Word, Excel, PowerPoint, PDF and images so it can be used and distributed, but still protect confidential information too. The redaction library offers a single format-independent interface to redact any type of classified information including social security numbers, medical information, financial, proprietary, legal or even trade details through text, metadata and annotation redaction types. It allows you to save the document in its original format and create a sanitized PDF document with raster images of original pages.
Search and redact exact matches of a search string
Control the redaction process and skip specific matches
Locate and redact using regular expressions
Built-in support for office formats and PDF
Wipe out metadata or redact metadata values
Limit redactions to specific worksheets and columns
Remove annotations or redact their texts
Use textual (exemption codes) or graphic (colored rectangles) redactions
Save the document in its original format or as a PDF with raster images of original pages
Support for raster image formats and image region redactions
Integration interface for implementing custom redaction and formats
Edit or Remove EXIF Metadata from Image Files
Redact Embedded Images inside the PDF, Word & Presentation Documents
GroupDocs.Redaction for Java library empowers developers to redact text and images from supported documents by employing a variety of redaction types. To use our Redaction API is simple and straight forward.
The following code example uses a tabular document such as Microsoft Excel spreadsheet where the scope of redaction can be limited to a specific worksheet and/or column. It uses filters to redact the second column with emails on a worksheet “Customers”, leaving all other emails untouched in the document.
final Redactor redactor = new Redactor("sample.xlsx");
try
{
CellFilter filter = new CellFilter();
filter.setColumnIndex(1);
filter.setWorkSheetName("Customers");
Pattern expression = Pattern.compile("^\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$");
RedactorChangeLog result = redactor.apply(new CellColumnRedaction(filter, expression, new ReplacementOptions("[customer email]")));
if (result.getStatus() != RedactionStatus.Failed)
{
SaveOptions so = new SaveOptions();
so.setAddSuffix(true);
so.setRasterizeToPDF(false);
redactor.save(so);
};
}
finally { redactor.close(); }