GroupDocs.Redaction for .NET 19.9 Release Notes
Major Features
Public API and Backward Incompatible Changes
Here are the key reasons to use the new updated API provided by GroupDocs.Redaction for .NET since version 19.9:
Redactor class was introduced as a single entry point to manage the document redaction process (instead of Documentclass from previous versions).
Methods RedactWith() of the Document class were replaced with similar Apply() methods in Redactor class.
Method Document.Save(Stream, SaveOptions) was replaced with Redactor.Save(Stream, RasterizationOptions).
Constructor LoadOptions(DocumentFormatConfiguration) was removed.
Exception and option classes were put in separate namespaces.
RedactionSummary was renamed into RedactorChangeLog, RedactionLogRecord into RedactorLogRecord, MetadataFilter into MetadataFilters.
Obsolete members were removed from public API.
Added a number of new exception classes and a base exception class for GroupDocs.Redaction exceptions.
Public API changes
Class DocumentFormatException has been moved to GroupDocs.Redaction.Exceptionsnamespace.
Class IncorrectPasswordException has been added to GroupDocs.Redaction.Exceptionsnamespace.
Class PasswordRequiredException has been added to GroupDocs.Redaction.Exceptionsnamespace.
Class TrialLimitationsException has been moved to GroupDocs.Redaction.Exceptionsnamespace.
Class GroupDocsRedactionException has been added to GroupDocs.Redaction.Exceptionsnamespace.
Class LoadOptions has been moved to GroupDocs.Redaction.Optionsnamespace.
Class RasterizationOptions has been moved to GroupDocs.Redaction.Optionsnamespace.
Class Save****Options has been moved to GroupDocs.Redaction.Optionsnamespace.
Class PreviewOptions has been added to GroupDocs.Redaction.Optionsnamespace.
Delegate CreatePageStream has been added to GroupDocs.Redaction.Optionsnamespace.
Delegate ReleasePageStream has been added to GroupDocs.Redaction.Optionsnamespace.
EnumerationEnumeration PdfComplianceLevelhas been moved to GroupDocs.Redaction.Options namespace.
Overloaded methods Load(…) have been replaced with constructors of GroupDocs.Redaction.Redactor class.
Class Document has been removed from public API.
Property FormatConfiguration has been removed from LoadOptions class.
Overloaded methods RedactWith(…) of the Document class has been replaced with Apply(…) methods of theGroupDocs.Redaction.Redactor class.
Overloaded methods DetermineFormat(…) have been removed from public API.
Obsolete property IsValidLicense has been removed fromGroupDocs.Redaction.Licenseclass.
Method GetDocumentInfo() has been added to GroupDocs.Redaction.Redactorclass.
Method GeneratePreview(GroupDocs.Redaction.Options.PreviewOptions) has been added to GroupDocs.Redaction.Redactorclass.
Method SetAccessGranted(System.Boolean) has been added to GroupDocs.Redaction.Integration.DocumentFormatInstanceclass.
Class RedactionSummaryhas been renamed into RedactorChangeLog.
Class RedactionLogEntryhas been renamed into RedactorLogEntry.
Obsolete property Success has been removed fromGroupDocs.Redaction.RedactionResultclass.
Obsolete propertySuccess has been removed fromGroupDocs.Redaction.RedactorChangeLogclass.
Flagged enumeration MetadataFilterhas been renamed into MetadataFilters.
Class RedactionPolicy has been moved to GroupDocs.Redactionnamespace.
Interface IDocumentInfohas been added to GroupDocs.Redaction namespace.
Class DocumentInfo has been added to GroupDocs.Redactionnamespace.
Class FileTypehas been added to GroupDocs.Redaction namespace.
Class PageInfohas been added to GroupDocs.Redaction namespace.
Method Rasterize(System.IO.Stream, RasterizationOptions) has been added to GroupDocs.Redaction.Integration.IRasterizableDocumentinterface.
Usecases
The following example demonstrates how to redact Microsoft Office Word document and dumping statuses of applied redactions using the old and new API:
Old coding style
using (Document doc = Redactor.Load(@"Documents/Doc/sample.docx"))
{
// Here we can use document instance to perform redactions
RedactionSummary summary = doc.RedactWith(new ExactPhraseRedaction("John Doe", new ReplacementOptions("[personal]")));
foreach (RedactionLogEntry entry in summary.RedactionLog)
{
Console.WriteLine(entry.Status.ToString());
}
doc.Save();
}
New coding style
using (Redactor redactor = new Redactor(@"Documents/Doc/sample.docx"))
{
// Here we can use Redactor instance to perform redactions
RedactorChangeLog result = redactor.Apply(new ExactPhraseRedaction("John Doe", new ReplacementOptions("[personal]")));
foreach (RedactorLogEntry entry in result.RedactionLog)
{
Console.WriteLine(entry.Status.ToString());
}
redactor.Save();
}