GroupDocs.Redaction for .NET 23.6 Release Notes
Major Features
There are the following improvements in this release:
- Implement settings to set page and area scope for redactions
- Issue when using Aspose.PDF with GroupDocs.Redaction
Full List of Issues Covering all Changes in this Release
Key | Summary | Category |
---|---|---|
REDACTIONNET-420 | Implement settings to set page and area scope for redactions | Improvement |
REDACTIONNET-427 | Issue when using Aspose.PDF with GroupDocs.Redaction | Bug |
Public API and Backward Incompatible Changes
Implement settings to set page and area scope for redactions
This improvement allows users to specify page area and page range scope for textual redactions in a PDF file.
Issue when using Aspose.PDF with GroupDocs.Redaction
This bugfix resolves a PDF documents issue with Aspose.PDF starting from v22.8, when it is used in parallel in the same project with GroupDocs.Redaction.
Public API changes
Class RedactionFilter, representing base abstract class for redaction filters, has been added to GroupDocs.Redaction.Redactions namespace.
Class PageRangeFilter, setting redaction scope to a set of pagess, has been added to GroupDocs.Redaction.Redactions namespace.
Class PageAreaFilter, setting redaction scope to an area of any page, has been added to GroupDocs.Redaction.Redactions namespace.
Property Filters, getting and setting an array of RedactionFilter istances, have been added to GroupDocs.Redaction.Redactions.ReplacementOptions class.
Usage
The following example demonstrates how to apply redaction to the bottom half of the last page in a PDF document.
C#
using (Redactor redactor = new Redactor("Sample.pdf"))
{
// Get the actual size information for the last page:
IDocumentInfo info = redactor.GetDocumentInfo();
PageInfo lastPage = info.Pages[info.PageCount - 1];
ReplacementOptions options = new Redactions.ReplacementOptions("[secret]");
options.Filters = new RedactionFilter[] {
new PageRangeFilter(PageSeekOrigin.End, 0, 1),
new PageAreaFilter(new System.Drawing.Point(0, lastPage.Height/2),
new System.Drawing.Size(lastPage.Width, lastPage.Height / 2))
};
RedactorChangeLog result = redactor.Apply(new ExactPhraseRedaction("dolor", options));
if (result.Status != RedactionStatus.Failed)
{
redactor.Save();
};
}