<repositories>
<repository>
<id>repository.groupdocs.com</id>
<name>GroupDocs Repository</name>
<url>https://releases.groupdocs.com/java/repo/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.groupdocs</groupId>
<artifactId>groupdocs-redaction</artifactId>
<version>26.11</version>
</dependency>
</dependencies>repositories {
maven {
url 'https://releases.groupdocs.com/java/repo/'
}
}
compile(group: 'com.groupdocs', name: 'groupdocs-redaction', version: '26.11')<ivysettings>
<settings defaultResolver="chain"/>
<resolvers>
<chain name="chain">
<ibiblio name="GroupDocs Repository" m2compatible="true" root="https://releases.groupdocs.com/java/repo/"/>
</chain>
</resolvers>
</ivysettings>
<dependency org="com.groupdocs" name="groupdocs-redaction" rev="26.11">
<artifact name="groupdocs-redaction" ext="jar"/>
</dependency>resolvers += Resolver.url("GroupDocs Repository", url("https://releases.groupdocs.com/java/repo/"))
libraryDependencies += "com.groupdocs" % "groupdocs-redaction" % "26.11"GroupDocs.Redaction for Java Downloads
Product Page | Docs | Demos | API Reference | Examples | Blog | Free Support | Temporary License
GroupDocs.Redaction for Java is a document-sanitization API for permanently removing sensitive information. Redact text by exact phrase or regular expression, scrub or replace metadata, remove or rewrite annotations, black out image regions, delete whole pages, and rasterize the result so nothing redacted can be recovered — across Word, Excel, PowerPoint, PDF, images, and text formats through one unified API, with no MS Office, OpenOffice, or other external software required.
Get Started
Add the GroupDocs Maven repository and dependency to your pom.xml:
<repositories>
<repository>
<id>GroupDocsJavaAPI</id>
<name>GroupDocs Java API</name>
<url>https://releases.groupdocs.com/java/repo/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.groupdocs</groupId>
<artifactId>groupdocs-redaction</artifactId>
<version>26.11</version>
</dependency>
</dependencies>
import com.groupdocs.redaction.Redactor;
import com.groupdocs.redaction.redactions.ExactPhraseRedaction;
import com.groupdocs.redaction.redactions.ReplacementOptions;
try (Redactor redactor = new Redactor("document.docx")) {
redactor.apply(new ExactPhraseRedaction("confidential", new ReplacementOptions("[REDACTED]")));
redactor.save();
}
How It Works
The library is a self-contained on-premise Java JAR. Add it from the GroupDocs Maven repository, then load, redact, and save documents through a single API — no Microsoft Office or third-party desktop tools required. Works on Windows, Linux, and macOS with JDK 8+.
Features
- Text redaction — remove or replace text by exact phrase (case-sensitive or not) or by regular expression; draw a colored box over the match instead of replacing it.
- Metadata redaction — erase or rewrite document metadata by filter (author, company, comments, …) or by key/value pattern.
- Annotation redaction — replace annotation text by pattern or delete matching annotations entirely.
- Image-area redaction — black out a rectangular region of a page; combine text + image redaction for page areas.
- Page redaction — remove pages from the start or end of a document.
- Rasterization — flatten the output to a PDF (optionally with tilt / noise / border / grayscale) so redacted content cannot be extracted.
- OCR connectors — plug in
IOcrConnector(com.groupdocs.redaction.integration.ocr) to redact text recognized in images and scanned pages. - Custom rules & callbacks — plug in a custom redaction handler or an
IRedactionCallbackto accept/reject each match. - Document introspection — read format, page count, size, and per-page dimensions before processing; preview pages as JPEG, PNG, or BMP.
- Cross-platform — Windows, Linux, and macOS with a compatible Java runtime.
Common Tasks
- Strip personal data (names, SSNs, emails, phone numbers) from a contract before sharing
- Black out an exact phrase or a regex match across every page of a document
- Erase all metadata (or just author/company) from a DOCX, XLSX, or PDF
- Remove or rewrite annotations/comments left in a reviewed document
- Redact a fixed image region (a logo, a signature, a photo) on a page
- Rasterize a redacted document to PDF so nothing can be copied back out
Supported File Formats
For capability details per format (body, metadata, annotations, embedded images, OCR, page removal), see supported formats.
| Category | Formats |
|---|---|
| Word Processing | DOC, DOCX, DOCM, DOT, DOTX, DOTM, RTF, TXT, ODT, OTT |
| Spreadsheets | XLS, XLSX, XLSM, XLSB, XLT, XLTX, XLTM, CSV, TSV, TAB, ODS, OTS, NUMBERS |
| Presentations | PPT, PPTX, POTX, POTM, ODP, OTP |
| Fixed-Layout | |
| Images | BMP, JPG, JPEG, PNG, GIF, TIF, TIFF, JP2 |
| Web & Markdown | HTM, HTML, MD |
Examples
Redact an exact phrase
try (Redactor redactor = new Redactor("document.docx")) {
// case-insensitive by default; pass true for case-sensitive
redactor.apply(new ExactPhraseRedaction("John Doe", true, new ReplacementOptions("[CUSTOMER]")));
redactor.save();
}
Redact by regular expression
try (Redactor redactor = new Redactor("document.docx")) {
redactor.apply(new RegexRedaction("\\d{2,}", new ReplacementOptions("[NUMBER]")));
redactor.apply(new RegexRedaction("[\\w.%+-]+@[\\w.-]+\\.[A-Za-z]{2,}", new ReplacementOptions("[EMAIL]")));
redactor.save();
}
Draw a black box instead of replacing text
try (Redactor redactor = new Redactor("document.pdf")) {
redactor.apply(new ExactPhraseRedaction("Top Secret", new ReplacementOptions(java.awt.Color.BLACK)));
redactor.save();
}
Scrub metadata
try (Redactor redactor = new Redactor("document.docx")) {
redactor.apply(new EraseMetadataRedaction(MetadataFilters.All));
redactor.apply(new MetadataSearchRedaction(".*@acme\\.com", "[EMAIL]"));
redactor.save();
}
Black out an image region
try (Redactor redactor = new Redactor("scan.pdf")) {
redactor.apply(new ImageAreaRedaction(
new java.awt.Point(50, 60),
new RegionReplacementOptions(java.awt.Color.BLACK, new java.awt.Dimension(200, 80))));
redactor.save();
}
Save in the original format (no rasterization)
By default save() may rasterize depending on options. To keep the source format:
try (Redactor redactor = new Redactor("document.docx")) {
redactor.apply(new RegexRedaction("\\d+", new ReplacementOptions("[NUM]")));
SaveOptions options = new SaveOptions();
options.setRasterizeToPDF(false);
redactor.save(options); // writes a redacted DOCX
}
Get document info
try (Redactor redactor = new Redactor("document.pdf")) {
IDocumentInfo info = redactor.getDocumentInfo();
System.out.println("Type: " + info.getFileType());
System.out.println("Pages: " + info.getPageCount());
System.out.println("Size: " + info.getSize() + " bytes");
}
Evaluation Mode
The API works without a license in evaluation mode, with these limitations:
- A single process can open up to 25 documents.
- Trial badges / evaluation marks are still added to saved documents.
To remove these limitations, apply a license or request a temporary license:
License license = new License();
license.setLicense("path/to/GroupDocs.Redaction.lic");
System Requirements
- JDK 8 (1.8) or later (11 / 17 / 21 LTS recommended)
- Windows, Linux, or macOS with a compatible Java runtime
- No Microsoft Office, OpenOffice, or Adobe Acrobat required
More Resources
Also available for other platforms: .NET | Node.js via Java | Python via .NET
Product Page | Docs | Demos | API Reference | Examples | Blog | Free Support | Temporary License
| Version | Release Date |
|---|---|
| 26.11 | November 19, 2026 |
| 26.10 | November 17, 2026 |
| 26.7 | November 17, 2026 |
| 25.12 | December 26, 2025 |
| 25.5 | May 22, 2025 |
| 24.9 | May 3, 2025 |
| 24.1 | January 25, 2024 |
| 23.9 | September 8, 2023 |
| 23.7 | July 3, 2023 |
| 23.3 | March 29, 2023 |
| 23.2 | February 2, 2023 |
| 22.10 | October 19, 2022 |
| 21.12 | December 10, 2021 |
| 21.6 | June 25, 2021 |
| 21.1 | January 29, 2021 |
| 20.11 | November 13, 2020 |
| 20.7 | January 25, 2022 |
| 20.2 | February 28, 2020 |
| 20.1 | January 16, 2020 |
| 19.11 | January 25, 2022 |
| 19.6 | June 11, 2019 |

