Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GroupDocsGists/00e02fd174763521e39ce9ac4e6010bb to your computer and use it in GitHub Desktop.
Save GroupDocsGists/00e02fd174763521e39ce9ac4e6010bb to your computer and use it in GitHub Desktop.
// 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