Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Created January 14, 2020 07:48
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save GroupDocsGists/78cd1e2d6f6633a664ab85ee57924936 to your computer and use it in GitHub Desktop.
// For complete examples and data files, please go to https://github.com/groupdocs-redaction/GroupDocs.Redaction-for-.NET
RedactionPolicy policy = RedactionPolicy.Load("RedactionPolicy.xml");
foreach (var fileEntry in Directory.GetFileNames("C:\\Inbound"))
{
using (Redactor redactor = new Redactor(Path.Combine("C:\\Inbound\\", fileEntry)))
{
RedactorChangeLog result = redactor.Apply(policy);
String resultFolder = result.Status != RedactionStatus.Failed ? "C:\\Outbound\\Done\\" : "C:\\Outbound\\Failed\\";
using (Stream fileStream = File.Open(Path.Combine(resultFolder, fileEntry), FileMode.Open, FileAccess.ReadWrite))
{
redactor.Save(fileStream, new RasterizationOptions() { Enabled = false });
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment