GroupDocs.Redaction
24.6.0
dotnet add package GroupDocs.Redaction --version 24.6.0
NuGet\Install-Package GroupDocs.Redaction -Version 24.6.0
<PackageReference Include="GroupDocs.Redaction" Version="24.6.0" />
paket add GroupDocs.Redaction --version 24.6.0
#r "nuget: GroupDocs.Redaction, 24.6.0"
// Install GroupDocs.Redaction as a Cake Addin #addin nuget:?package=GroupDocs.Redaction&version=24.6.0 // Install GroupDocs.Redaction as a Cake Tool #tool nuget:?package=GroupDocs.Redaction&version=24.6.0
.NET API for Redacting Sensitive Data from Documents
GroupDocs.Redaction for .NET is a powerful API designed to redact classified or sensitive data from a variety of document types within your .NET applications. It supports multiple redaction types including text, metadata, annotations, and image redactions. The API also integrates with OCR engines for redacting text within images and provides the ability to remove pages and embedded images, ensuring the comprehensive redaction of confidential information. GroupDocs.Redaction is highly versatile, supporting a wide range of document formats, making it an essential tool for any organization dealing with sensitive information.
GroupDocs.Redaction for .NET Key Features
Text Redactions
- Exact Phrase Redaction: Search and redact specific phrases or text strings with case-sensitivity options.
- Regex Redaction: Redact text based on regular expressions for flexible text matching.
- Right-to-Left Support: Redaction of right-to-left text such as Arabic and Hebrew.
Metadata Redactions
- Erase Metadata: Remove all metadata from a document, such as author, date created, and comments.
- Metadata Search Redaction: Remove sensitive information from metadata fields using regular expressions.
Annotation Redactions
- Delete Annotations: Remove annotations, comments, and other markup from documents.
- Redact Annotation Text: Redact sensitive data in annotations while keeping the annotations intact.
Spreadsheet Redactions
- Cell and Column Redaction: Redact specific cells or entire columns within Excel spreadsheets.
- Filter by Worksheet: Apply redactions to specific worksheets in Excel files.
Image Redactions
- Image Area Redaction: Cover specific areas of images, such as headers or footers, with a colored box.
- OCR-Based Redaction: Use Optical Character Recognition (OCR) to recognize and redact text embedded in images.
- EXIF Data Removal: Remove metadata (e.g., EXIF data) from images, acting as an "EXIF eraser."
Page Redactions
- Remove Pages: Remove specific pages from documents such as PDFs, slideshows, or spreadsheets.
- Page Area Filters: Apply redactions to specific areas on a page using coordinates.
Embedded Image Redactions
- Redact embedded images in documents, including PDF, Microsoft Office, and OpenOffice files.
Rasterization
- Convert to Raster Images: Redact sensitive data and save documents as raster images, making all data unsearchable.
- Document Saving Options: Save redacted documents in either original format for further editing or in raster format for increased security.
Support for OCR Engines
- Integrate third-party OCR engines (e.g., Aspose.OCR or Microsoft Azure Computer Vision API) to recognize and redact text from images or image-based PDFs.
File and Document Information
- Document Info Retrieval: Retrieve metadata and page counts for any document format.
Supported Document Formats
The following table indicates the file formats supported by GroupDocs.Redaction for .NET.
Format | Description | Document body | Metadata | Annotations (comments) | Remarks | Embedded images | OCR | Remove Page | Page Filters |
---|---|---|---|---|---|---|---|---|---|
Saves the document as PDF (Adobe Portable Document) format | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ||
DOC | Microsoft Word 97 - 2007 Document. | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ||
DOT | Microsoft Word 97 - 2007 Template. | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ||
DOCX | Office Open XML WordprocessingML Document (macro-free) | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ||
DOCM | Office Open XML WordprocessingML Macro-Enabled Document | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ||
DOTX | Office Open XML WordprocessingML Template (macro-free) | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ||
DOTM | Office Open XML WordprocessingML Macro-Enabled Template | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ||
RTF | RTF format. | ✔ | ✔ | ✔ | ✔ | ✔ | |||
XLSX | OOXML 2007-2010 | ✔ | ✔ | ✔ | ✔ | ||||
XLSM | OOXML Macro Enabled Workbook | ✔ | ✔ | ✔ | ✔ | ||||
XLTX | OOXML Workbook Template | ✔ | ✔ | ✔ | ✔ | ||||
XLTM | OOXML Macro Enabled Workbook Template | ✔ | ✔ | ✔ | ✔ | ||||
XLS | Excel Workbook 97-2003 | ✔ | ✔ | ✔ | ✔ | ||||
XLT | Excel Workbook Template 97-2003 | ✔ | ✔ | ✔ | ✔ | ||||
CSV | CSV (Comma Separated Value) file. | ✔ | ✔ | ✔ | |||||
PPTX | OOXML Microsoft PowerPoint Presentations format | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | |
PPT | PowerPoint Presentation 97-2003 | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | |
PPSX | PowerPoint Open XML | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | |
POT | PowerPoint template files | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | |
PPS | Microsoft PowerPoint 97-2003 Slide Show | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | |
PPTM | Microsoft PowerPoint Open XML Macro-Enabled Presentation file | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | |
PPSM | Microsoft PowerPoint Open XML Macro-Enabled Slide Show file | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | |
POTM | Microsoft PowerPoint template | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | |
JPEG | The image file format was standardized by the Joint Photographic Experts Group. | ✔ | ✔ | ✔ | ✔ | ||||
TIF/TIFF | Tagged Image File Format | ✔ | ✔ | ✔ | ✔ | ✔ | |||
PNG | Portable Network Graphics Image | ✔ | ✔ | ✔ | ✔ | ||||
BMP | Bitmap Image Files | ✔ | ✔ | ✔ | ✔ | ||||
GIF | Graphical Interchange Format Image | ✔ | ✔ | ✔ | |||||
DJVU | DjVu Document Format | ✔ | ✔ |
System Requirements
Category | Details |
---|---|
Overview | GroupDocs.Redaction for .NET does not require any external software or third-party tool to be installed. |
Just follow one of the ways described in Development Environment, Installation, and Configuration. | |
Supported Operating Systems | Windows: - Microsoft Windows 2003 Server (x64, x86) - Microsoft Windows 2008 Server (x64, x86) - Microsoft Windows 2012 Server (x64, x86) - Microsoft Windows 2012 R2 Server (x64, x86) - Microsoft Windows 2016 Server (x64, x86) - Microsoft Windows 2019 Server (x64, x86) - Microsoft Windows Vista (x64, x86) - Microsoft Windows XP (x64, x86) - Microsoft Windows 7 (x64, x86) - Microsoft Windows 8, 8.1 (x64, x86) - Microsoft Windows 10 (x64, x86) UNIX: - Linux or any platform supporting .NET Core 3.1 |
Supported Frameworks | .NET Frameworks: - .NET Framework 2.0 - .NET Framework 3.5 - .NET Framework 4.0 - .NET Framework 4.0_ClientProfile - .NET Framework 4.5.0 - .NET Framework 4.5.1 - .NET Framework 4.5.2 - .NET Framework 4.6.0 - .NET Framework 4.6.2 - .NET Framework 4.7 - .NET Framework 4.7.2 - .NET Standard 2.0 .NET Core Framework: - .NET Core 2.0 and later |
Development Environments | GroupDocs.Redaction for .NET can be used to develop applications in any development environment that targets the .NET platform, but the following environments are explicitly supported: - Microsoft Visual Studio 2010 - Microsoft Visual Studio 2011 - Microsoft Visual Studio 2012 - Microsoft Visual Studio 2013 - Microsoft Visual Studio 2015 - Microsoft Visual Studio 2017 - Microsoft Visual Studio 2019 |
Get Started with GroupDocs.Redaction for .NET
Below is an overview of the key steps and code examples that will help you begin using the API in your .NET applications.
Install GroupDocs.Redaction via NuGet
Package Manager GUI:
- Open your solution/project in Visual Studio.
- Navigate to Tools → NuGet Package Manager → Manage NuGet Packages for Solution.
- Search for "GroupDocs.Redaction" and click "Install" to add the latest version to your project.
Package Manager Console:
- Open Package Manager Console in Visual Studio.
- Run the following command:
Install-Package GroupDocs.Redaction
Install from the Official GroupDocs Website
- Download the package from the official website.
- Unpack the archive or follow the MSI install wizard.
- In Solution Explorer, right-click the References node and select "Add Reference."
- Locate and add the
GroupDocs.Redaction.dll
file.
GroupDocs.Redaction for .NET Code Samples
Code Sample 1: Apply Exact Phrase Redaction
This code sample demonstrates how to apply an exact phrase redaction to a document, replacing a specific phrase with a custom string or a colored rectangle. This C# example shows how to redact sensitive information from a document by replacing exact phrases using GroupDocs.Redaction for .NET.
// Learn how to apply an exact phrase redaction to a document using GroupDocs.Redaction for .NET. Replace sensitive phrases with custom text or a color block.
// Import necessary namespaces
using GroupDocs.Redaction;
using GroupDocs.Redaction.Options;
namespace RedactionExample
{
class Program
{
static void Main(string[] args)
{
// Load the document from the local file system
using (Redactor redactor = new Redactor("sample.docx"))
{
// Apply an exact phrase redaction
// Replace "John Doe" with "[personal]" in the document
RedactorChangeLog result = redactor.Apply(new ExactPhraseRedaction("John Doe", new ReplacementOptions("[personal]")));
// Check if the redaction was applied successfully
if (result.Status != RedactionStatus.Failed)
{
// Save the redacted document
redactor.Save();
}
}
}
}
}
Code Sample 2: Redact Metadata in a Document
This example demonstrates how to remove sensitive data from a document's metadata using a regular expression. It targets specific metadata fields like the author's name. This C# example demonstrates how to redact metadata in a document by targeting specific fields such as the author’s name using GroupDocs.Redaction for .NET.
// Redact metadata in a document using GroupDocs.Redaction for .NET. Remove or replace sensitive metadata fields like author names.
// Import necessary namespaces
using GroupDocs.Redaction;
using GroupDocs.Redaction.Redactions;
using GroupDocs.Redaction.Options;
namespace RedactionExample
{
class Program
{
static void Main(string[] args)
{
// Load the document from the local file system
using (Redactor redactor = new Redactor("sample.docx"))
{
// Create a metadata redaction targeting the author's name
MetadataSearchRedaction redaction = new MetadataSearchRedaction("Company Ltd.", "--company--");
// Apply the redaction to the document's metadata
redactor.Apply(redaction);
// Save the redacted document
redactor.Save();
}
}
}
}
Code Sample 3: Redact Image Area in a Document
This C# example demonstrates how to redact a specific area of an image embedded in a document by placing a colored rectangle using GroupDocs.Redaction for .NET.
// Redact specific areas within images embedded in documents using GroupDocs.Redaction for .NET. Overlay colored rectangles on sensitive image regions.
// Import necessary namespaces
using GroupDocs.Redaction;
using GroupDocs.Redaction.Redactions;
using System.Drawing;
namespace RedactionExample
{
class Program
{
static void Main(string[] args)
{
// Load the document containing the image from the local file system
using (Redactor redactor = new Redactor("sample.docx"))
{
// Define the area of the image to be redacted (coordinates and size)
Point samplePoint = new Point(516, 311);
Size sampleSize = new Size(170, 35);
// Apply the redaction by placing a blue rectangle over the specified area
RedactorChangeLog result = redactor.Apply(new ImageAreaRedaction(samplePoint, new RegionReplacementOptions(Color.Blue, sampleSize)));
// Check if the redaction was applied successfully
if (result.Status != RedactionStatus.Failed)
{
// Save the redacted document
redactor.Save();
}
}XX
}
}
}
Please check the GitHub Repository for other common usage scenarios.
Product Page | Docs | Demo | API Reference | Examples | Blog | Releases | Free Support | Temporary License
Here's the content converted to the standard NuGet readme format:
Tags
.NET API | Document Redaction | Sensitive Data Removal | Text Redaction | Metadata Redaction | Image Redaction | OCR Redaction | Regex Redaction | Annotation Redaction | Page Redaction | Document Privacy | Redact PDF | Redact Word Documents | Redact Excel Spreadsheets | EXIF Data Removal | Raster Image Conversion | Secure Document Redaction | Document Anonymization | Cross-Platform Redaction | API for Data Security | GroupDocs.Redaction | Document Cleanup | Microsoft Word Redaction | Excel File Redaction | PowerPoint Redaction | PDF Security | Data Sanitization
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
.NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- No dependencies.
-
.NETStandard 2.1
- Microsoft.Extensions.DependencyModel (>= 2.0.4)
- Microsoft.Extensions.Logging.Abstractions (>= 7.0.0)
- Microsoft.Win32.Registry (>= 4.7.0)
- Newtonsoft.Json (>= 13.0.3)
- SkiaSharp (>= 2.88.6)
- SkiaSharp.NativeAssets.Linux.NoDependencies (>= 2.80.3)
- System.Diagnostics.DiagnosticSource (>= 7.0.0)
- System.Diagnostics.PerformanceCounter (>= 4.5.0)
- System.Drawing.Common (>= 6.0.0)
- System.Reflection.Emit (>= 4.7.0)
- System.Reflection.Emit.ILGeneration (>= 4.3.0)
- System.Security.Cryptography.Pkcs (>= 5.0.1)
- System.Security.Permissions (>= 4.5.0)
- System.Text.Encoding.CodePages (>= 7.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
24.6.0 | 991 | 7/1/2024 |
23.11.0 | 2,432 | 11/3/2023 |
23.8.0 | 10,667 | 8/18/2023 |
23.6.0 | 2,511 | 6/28/2023 |
23.3.0 | 1,881 | 3/24/2023 |
23.1.0 | 1,495 | 1/26/2023 |
22.8.0 | 2,628 | 8/25/2022 |
22.7.0 | 2,148 | 7/19/2022 |
21.9.0 | 31,712 | 9/22/2021 |
21.3.0 | 22,721 | 3/31/2021 |
21.1.0 | 37,807 | 1/29/2021 |
20.11.0 | 45,478 | 11/13/2020 |
20.9.0 | 17,265 | 9/30/2020 |
20.7.0 | 30,217 | 7/30/2020 |
20.2.0 | 130,768 | 2/28/2020 |
19.12.0 | 43,387 | 12/25/2019 |
19.12.0-alpha-20191224151538 | 702 | 12/25/2019 |
19.9.0 | 26,623 | 9/25/2019 |
19.5.1 | 783 | 5/31/2019 |
19.5.0 | 679 | 5/30/2019 |
19.3.0 | 819 | 3/12/2019 |
19.1.0 | 926 | 1/31/2019 |