GroupDocs.Redaction for .NET 26.9 Release Notes
Explore the latest updates, improvements, and fixes in GroupDocs.Redaction for .NET 26.9 in these release notes.
Major Features
This release brings the following improvements to GroupDocs.Redaction for .NET:
- Improved cross-platform compatibility by removing the
System.Drawing.Commondependency from the .NET 6, .NET 8, and .NET 10 packages. The .NET Framework 4.6.2 build still uses the Windows GDI+ stack.
This major change resulted in many changes to the public API:
- Removed
System.Drawingtypes from the public API. Color, point, size, rectangle, and font types are now provided by theGroupDocs.Redaction.Options.Drawingnamespace. - Restored the original member names as the current API.
BoxColor,FillColor,Size,TopLeft, andRectanglenow useGroupDocs.Redaction.Options.Drawingtypes. The temporary aliases introduced in 26.6 (BoxFillColor,AreaFillColor,AreaSize,TopLeftPosition,AreaRectangle, andBoundingRectangle) are obsolete.
Full List of Issues Covering all Changes in this Release
| Key | Summary | Category |
|---|---|---|
| REDACTIONNET-799 | Migrate Away from System.Drawing to Enhance Cross-Platform Compatibility | Enhancement |
Public API and Backward Incompatible Changes
This section lists the public API changes introduced in GroupDocs.Redaction for .NET 26.9. It includes not only new and obsolete public methods but also descriptions of any behind-the-scenes changes in GroupDocs.Redaction that may affect existing code. Any modifications that could be considered regressions or alter existing behavior are particularly important and are documented here.
Public API changes
Code that still passes System.Drawing.Color, System.Drawing.Point, System.Drawing.Size, System.Drawing.Rectangle, or System.Drawing.Font will no longer compile. Replace them with the corresponding types from the GroupDocs.Redaction.Options.Drawing namespace.
- Removed public members that accepted or returned
System.Drawingtypes fromReplacementOptions,RegionReplacementOptions,ImageAreaRedaction,PageAreaFilter,TextFragment, andIImageFormatInstance. ReplacementOptions.BoxColoris the current property and usesGroupDocs.Redaction.Options.Drawing.Color.ReplacementOptions.BoxFillColoris obsolete.ReplacementOptions(GroupDocs.Redaction.Options.Drawing.Color)is the colored-box constructor. TheSystem.Drawing.Colorconstructor was removed.RegionReplacementOptions.FillColorandRegionReplacementOptions.Sizeare the current properties.AreaFillColorandAreaSizeare obsolete.RegionReplacementOptions(GroupDocs.Redaction.Options.Drawing.Color, GroupDocs.Redaction.Options.Drawing.Size)andRegionReplacementOptions(GroupDocs.Redaction.Options.Drawing.Color, GroupDocs.Redaction.Options.Drawing.Font, string)are the current constructors. TheSystem.Drawingconstructors were removed.ImageAreaRedaction.TopLeftis the current property and usesGroupDocs.Redaction.Options.Drawing.Point.TopLeftPositionis obsolete.ImageAreaRedaction(GroupDocs.Redaction.Options.Drawing.Point, RegionReplacementOptions)is the current constructor. TheSystem.Drawing.Pointconstructor was removed.PageAreaFilter.Rectangleis the current property and usesGroupDocs.Redaction.Options.Drawing.Rectangle.AreaRectangleis obsolete.PageAreaFilter(GroupDocs.Redaction.Options.Drawing.Point, GroupDocs.Redaction.Options.Drawing.Size)is the current constructor. TheSystem.Drawingconstructor was removed.TextFragment.Rectangleis the current property and usesGroupDocs.Redaction.Options.Drawing.Rectangle.BoundingRectangleis obsolete.TextFragment(string, GroupDocs.Redaction.Options.Drawing.Rectangle)is the current constructor. TheSystem.Drawing.Rectangleconstructor was removed.IImageFormatInstance.EditAreaacceptsGroupDocs.Redaction.Options.Drawing.Pointonly.
Usage
Use GroupDocs.Redaction.Options.Drawing for a colored box and for an image-area redaction:
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.Black)));
redactor.Save();
}
using (Redactor redactor = new Redactor("sample.jpg"))
{
redactor.Apply(new ImageAreaRedaction(
new Point(516, 311),
new RegionReplacementOptions(Color.Blue, new Size(170, 35))));
redactor.Save();
}
If you moved to the temporary names in 26.6, switch back to the original member names:
| Obsolete alias | Use instead |
|---|---|
ReplacementOptions.BoxFillColor | ReplacementOptions.BoxColor |
RegionReplacementOptions.AreaFillColor | RegionReplacementOptions.FillColor |
RegionReplacementOptions.AreaSize | RegionReplacementOptions.Size |
ImageAreaRedaction.TopLeftPosition | ImageAreaRedaction.TopLeft |
PageAreaFilter.AreaRectangle | PageAreaFilter.Rectangle |
TextFragment.BoundingRectangle | TextFragment.Rectangle |