Browse our Products

If so you can download any of the below versions for testing. The product will function as normal except for an evaluation limitation. At the time of purchase we provide a license file via email that will allow the product to work in its full capacity. If you would also like an evaluation license to test without any restrictions for 30 days, please follow the directions provided here.

GroupDocs.Redaction for Node.js via Java Downloads

banner

NPM NPM Downloads

Product Page | Docs | Demos | API Reference | Examples | Blog | Free Support | Temporary License

GroupDocs.Redaction for Node.js via 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 Node.js API, with no MS Office, OpenOffice, or other external software required.

Get Started

npm i @groupdocs/groupdocs.redaction
const redaction = require('@groupdocs/groupdocs.redaction');

const redactor = new redaction.Redactor('document.docx');
try {
  redactor.apply(new redaction.ExactPhraseRedaction(
    'confidential',
    new redaction.ReplacementOptions('[REDACTED]')));
  redactor.save();
} finally {
  redactor.close();
}

How It Works

Install the package from npm, set up a supported Node.js and JVM environment once, then call the redaction API from JavaScript. The library loads, redacts, and saves documents through a single Node.js surface — no Microsoft Office or third-party desktop tools required. Works on Windows, Linux, and macOS.

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 advanced raster options) so redacted content cannot be extracted.
  • Custom rules & callbacks — plug in a custom redaction handler or an IRedactionCallback to accept/reject each match.
  • Document introspection — read format, page count, size, and per-page dimensions before processing.
  • Cross-platform — Windows, Linux, and macOS with Node.js LTS.

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 a complete list, see supported formats.

CategoryFormats
Word ProcessingDOC, DOCX, DOCM, DOT, DOTX, DOTM, RTF, TXT, ODT, OTT
SpreadsheetsXLS, XLSX, XLSM, XLSB, CSV, TSV, ODS, OTS
PresentationsPPT, PPTX, ODP
Fixed-LayoutPDF
ImagesBMP, JPG, JPEG, PNG, GIF, TIF, TIFF, JP2
Web & MarkdownHTM, HTML, MD

Examples

Redact an exact phrase

const redaction = require('@groupdocs/groupdocs.redaction');

const redactor = new redaction.Redactor('document.docx');
try {
  redactor.apply(new redaction.ExactPhraseRedaction(
    'John Doe',
    true, // case-sensitive
    new redaction.ReplacementOptions('[CUSTOMER]')));
  redactor.save();
} finally {
  redactor.close();
}

Redact by regular expression

const redaction = require('@groupdocs/groupdocs.redaction');

const redactor = new redaction.Redactor('document.docx');
try {
  redactor.apply(new redaction.RegexRedaction(
    '\\d{2,}',
    new redaction.ReplacementOptions('[NUMBER]')));
  redactor.apply(new redaction.RegexRedaction(
    '[\\w.%+-]+@[\\w.-]+\\.[A-Za-z]{2,}',
    new redaction.ReplacementOptions('[EMAIL]')));
  redactor.save();
} finally {
  redactor.close();
}

Draw a black box instead of replacing text

const redaction = require('@groupdocs/groupdocs.redaction');
const java = require('java');
const Color = java.import('java.awt.Color');

const redactor = new redaction.Redactor('document.pdf');
try {
  redactor.apply(new redaction.ExactPhraseRedaction(
    'Top Secret',
    new redaction.ReplacementOptions(Color.BLACK)));
  redactor.save();
} finally {
  redactor.close();
}

| Product Home | Documentation | Blog | Code Samples | Free Support | Temporary License | Pricing |



Direct Download