Dear GroupDocs Customers,
We are pleased to announce the release of GroupDocs.Redaction for .NET v26.6. This release focuses on more reliable document loading from streams and files, and on preparing the public API for broader cross-platform use by introducing drawing types that are independent of System.Drawing.
Key New Features
- Explicit file type loading – Specify the document format when opening a file or stream using
LoadOptions.FileType. - Cross-platform drawing types – New
GroupDocs.Redaction.Options.Drawingnamespace withColor,Point,Size,Rectangle,Font, andFontStyle. - Backward-compatible API migration – Existing
System.Drawing-based members remain available but are marked obsolete; new overloads use theOptions.Drawingtypes.
Explicit File Type Loading
GroupDocs.Redaction normally detects document format automatically. That works well when the file has a correct extension, but it can be unreliable for streams without a file name or when the extension does not match the actual content.
Starting with v26.6, you can set LoadOptions.FileType to a supported FileType constant (for example, FileType.DOCX or FileType.PDF). The library then opens the document using the specified format and skips binary format detection. The default behavior is unchanged when FileType is not specified or remains FileType.Unknown.
using System.IO;
using GroupDocs.Redaction.Options;
using GroupDocs.Redaction.Redactions;
using (Stream stream = File.OpenRead("sample.docx"))
{
using (Redactor redactor = new Redactor(stream, new LoadOptions(FileType.DOCX)))
{
redactor.Apply(new DeleteAnnotationRedaction());
redactor.Save();
}
}
Cross-Platform Drawing API
Several redaction options previously relied on System.Drawing types such as Color, Point, Size, Rectangle, and Font. These types are not available on all platforms and can complicate deployment on Linux and in containerized environments.
Version 26.6 introduces the GroupDocs.Redaction.Options.Drawing namespace and new overloads in ReplacementOptions, RegionReplacementOptions, ImageAreaRedaction, PageAreaFilter, TextFragment, and related APIs. Existing code that uses System.Drawing continues to compile and run, but the corresponding members are marked obsolete and should be migrated to the new types.
using GroupDocs.Redaction.Options.Drawing;
using GroupDocs.Redaction.Redactions;
using (Redactor redactor = new Redactor("sample.docx"))
{
redactor.Apply(new ExactPhraseRedaction("John Doe", new ReplacementOptions(Color.Red)));
redactor.Save();
}
Migration Notes
This release does not introduce breaking changes. All System.Drawing-based members remain functional but are marked obsolete. We recommend updating your code to use GroupDocs.Redaction.Options.Drawing types to ensure compatibility with future releases and non-Windows environments.
Useful Links
- Full Release Notes – View the complete list of changes and technical details.
- Download from NuGet – Update your project to the latest version.
- Product Documentation – Explore guides and API references.
We believe these improvements will make GroupDocs.Redaction easier to integrate in modern .NET applications and deliver even greater value to our customers.
As always, we highly value your feedback. Please let us know if you have any questions, suggestions, or feature requests for upcoming releases.
Best regards,
The GroupDocs Team