Skip to end of metadata
Go to start of metadata
Contents Summary
 

The code in below examples uses some methods defined in the Common Utilities.

Using Redaction Callback

Using GroupDocs.Redaction API, you can reject specific changes during the redaction process keep a full log of changes in the document. To use redaction callback you can set  Redactor.RedactionCallback property to a class implementing IRedactionCallback interface. The interface contains only one method, AcceptRedaction, which receives detailed information about proposed redaction and returns a boolean value, accepted or not. 

RedactionDump Class

Following is the RedactionDump callback class, to dump changes on the system console. 

The Recipe

  • Load Document using Redactor.Load(@"C:\sample.docx")

  • Intialize RedactionCallback before applying redaction using Redactor.RedactionCallback = new RedactionDump()

  • Perform redaction using Document.RedactWith(new ExactPhraseRedaction("John Doe", new ReplacementOptions("[personal]"))) and RedactionDump will be printed on console

  • Save document using Document.Save(new SaveOptions(false, "AnyText"))

The Code

Labels
  • No labels