Created
January 14, 2020 07:48
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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