SoftZenPdf.Redact 1.1.0

dotnet add package SoftZenPdf.Redact --version 1.1.0
                    
NuGet\Install-Package SoftZenPdf.Redact -Version 1.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SoftZenPdf.Redact" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SoftZenPdf.Redact" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="SoftZenPdf.Redact" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SoftZenPdf.Redact --version 1.1.0
                    
#r "nuget: SoftZenPdf.Redact, 1.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SoftZenPdf.Redact@1.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SoftZenPdf.Redact&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=SoftZenPdf.Redact&version=1.1.0
                    
Install as a Cake Tool

SoftZenPdf.Redact

Secure redaction for SoftZenPdf. Find text with regular expressions or mark areas, and remove what lies underneath from the PDF itself, not just cover it with a black box.

dotnet add package SoftZenPdf.Redact

Requires .NET 8 or later. Brings in SoftZenPdf (the same version). No native libraries.

Redact by pattern or area

using SoftZenPdf.Redact;

var redactor = PdfRedactor.Open("record.pdf");
redactor.RedactText(@"\d{3}-\d{2}-\d{4}");                 // social security numbers
redactor.RedactText(@"[\w.+-]+@[\w-]+\.[\w.]+");           // email addresses
redactor.RedactArea(pageIndex: 0, 72, 600, 300, 640);       // a signature block

var result = redactor.Save("record-redacted.pdf");
Console.WriteLine($"{result.RemovedCharacters} characters removed; {result.RemainingMatches.Count} matches left");

Preview first with redactor.Find(pattern), which returns each match's text and areas without marking anything.

What is removed

  • Text: the covered glyphs are cut out of the page content, so they cannot be selected, copied, searched or extracted. A partly covered word loses only its covered letters, and nothing around it moves. Invisible text, such as an OCR layer, goes too.
  • Vector graphics: fills and strokes lose exactly the covered part of their geometry.
  • Images: the covered pixels are blanked in the image data (JPEG, CCITT fax, Flate and more), and the image is stored again without them; images entirely inside an area are removed.
  • Around the page: annotations and form fields under an area; text matching your patterns in the document metadata and XMP, bookmarks, annotation notes, form values and the structure tree's alternate text.
  • History: the output is a new file, not an update of the original. Earlier revisions, unused objects and encryption are not carried over, so nothing removed can be recovered from it.

After saving, the output is searched again for every pattern; RemainingMatches lists anything still found.

Options

  • FillColor: the colour of the box drawn over each area (black by default), or null for no box.
  • ScrubDocumentText: whether patterns are also removed from metadata, bookmarks, annotations and form values (on by default).
  • RedactText(pattern, margin): grow each match's area by a margin in points.

Limits

  • JBIG2 and JPEG 2000 images that are only partly covered are removed entirely (and reported in Warnings), as they cannot be decoded.
  • A redacted JPEG is stored losslessly, so it grows.
  • Embedded fonts are kept, so a font subset still lists the characters a document used.
  • Pattern matching sees text as the page reads it; text drawn as images (scans without an OCR layer) needs areas or OCR first (see SoftZenPdf.Ocr).

Documentation and licensing

Guide: https://pdf.softzensystems.com/docs/guides/redaction
API reference: https://pdf.softzensystems.com/api/

SoftZenPdf.Redact is commercial software covered by your SoftZenPdf license, with a free Community license for individuals and organisations under US$1 million annual revenue; see https://pdf.softzensystems.com/pricing. Without a license key, saved pages carry an evaluation mark.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.1.0 134 10/2/2026

First release: regex and area redaction that removes text, vector graphics and image pixels from page content, cleans annotations, form fields, metadata, bookmarks and the structure tree, and verifies the result. Full notes: https://pdf.softzensystems.com/changelog