@groupdocs/groupdocs.redaction
v26.10.0
Published
Document redaction API for Node.js (powered by Java). Permanently remove or mask sensitive text, metadata, annotations, and image areas from PDF, Office, and image files.
Readme
Document redaction API for Node.js (powered by Java) to permanently remove or mask sensitive text, metadata, annotations, and image areas from PDF, Word, Excel, PowerPoint, images, and other supported formats.
Quick links
Key Features
- Redact text with exact phrase or regular expression (replacement text or colored box).
- Erase or search/replace metadata and annotations.
- Redact image areas and embedded images; optional OCR connectors.
- Spreadsheet column filters and page remove/rasterize workflows.
- Save in the original format or as a rasterized PDF.
- Same public API surface as GroupDocs.Redaction for Java (via Node.js bridge).
Supported Formats
Redact documents in supported file formats (PDF, DOCX, XLSX, PPTX, images, and more).
Getting Started
Prerequisites
- Node.js (LTS recommended)
- Java Runtime Environment (JRE) 8 or later (
JAVA_HOMEconfigured) - Windows, Linux, or macOS
Installation
npm i @groupdocs/groupdocs.redactionThe postinstall script downloads groupdocs-redaction-nodejs-26.10.jar into lib/.
Use cases
Exact phrase redaction
const redaction = require('@groupdocs/groupdocs.redaction');
const license = new redaction.License();
license.setLicense('GroupDocs.Redaction.lic');
const redactor = new redaction.Redactor('sample.docx');
try {
redactor.apply(new redaction.ExactPhraseRedaction(
'John Doe',
new redaction.ReplacementOptions('[personal]')));
redactor.save();
} finally {
redactor.close();
}Regex redaction with colored box
const redaction = require('@groupdocs/groupdocs.redaction');
const java = require('java');
const Color = java.import('java.awt.Color');
const redactor = new redaction.Redactor('sample.pdf');
try {
redactor.apply(new redaction.RegexRedaction(
'\\d{3}-\\d{2}-\\d{4}',
new redaction.ReplacementOptions(Color.BLACK)));
const options = new redaction.SaveOptions();
options.setRasterizeToPDF(true);
redactor.save(options);
} finally {
redactor.close();
}Build notes (maintainers)
- Publish JAR from
java-newwith-Pfinal,nodejs(com.groupdocs:groupdocs-redaction-nodejs:26.10). - Init submodule:
git submodule update --init --recursive - GenJS (CI
build_stageor local Gradle injava-to-node.js-generator) produceslib/groupdocs.redaction.jsusing regex overcom.groupdocs.redaction.**(excludinginternal). - ProGuard / jarjar rules live only in the Java repo (
config/groupdocs-redaction.pro,groupdocs-redaction.rules).
Licensing
This library is supplied under the GroupDocs End User License Agreement. Evaluation mode applies without a license (see documentation).
