Last active
April 10, 2019 08:15
-
-
Save GroupDocsGists/00e02fd174763521e39ce9ac4e6010bb to your computer and use it in GitHub Desktop.
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-comparison/GroupDocs.Comparison-for-.NET | |
Comparer comparer = new Comparer(); | |
//compare document | |
ICompareResult result = comparer.Compare(Path.Combine(Common.sourcePath, Common.sourceFile), Path.Combine(Common.targetPath, Common.targetFile), new ComparisonSettings { StyleChangeDetection = true, ShowDeletedContent = true, GenerateSummaryPage = true }); | |
result.SaveDocument(Path.Combine(Common.resultPath, Common.resultFile)); | |
//get list of pages | |
List<PageImage> resultImages = comparer.ConvertToImages(Path.Combine(Common.resultPath, Common.resultFile)); | |
//save them as bitmap to separate folder | |
if (!Directory.Exists(Common.resultPath + @"/Result Pages")) | |
Directory.CreateDirectory(Common.resultPath + @"/Result Pages"); | |
foreach (PageImage image in resultImages) | |
{ | |
Bitmap bitmap = new Bitmap(image.PageStream); | |
bitmap.Save(Common.resultPath + @"/Result Pages/result_" + image.PageNumber + ".png"); | |
bitmap.Dispose(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment