GroupDocs.Comparison allows you to detect changes between source and target files and create the summary page only.
The following code snippet shows how to get only a summary page.
'use strict';// Import the GroupDocs Comparison Node.js SDK
constgroupdocs=require('@groupdocs/groupdocs.comparison');// Define file paths for source, target, and output documents
constsourcePath='sample-files/source.docx';consttargetPath='sample-files/target.docx';constoutputPath='result.docx';// Initialize comparer with the source document
constcomparer=newgroupdocs.Comparer(sourcePath);// Add the target document to be compared with the source
comparer.add(targetPath);// Create comparison options and configure to show only summary page
constoptions=newgroupdocs.CompareOptions();options.setShowOnlySummaryPage(true);// enable summary-only view
// Execute comparison and save result to output path
comparer.compare(outputPath,options);// Terminate the process with a success exit code
process.exit(0);
This example creates a Comparer instance with the source document, adds the target document, and creates a CompareOptions object. It sets setShowOnlySummaryPage(true) to generate only the summary page without the full document content. When the comparison is performed, the result document will contain only the summary page with statistics about detected changes, making it useful for quick overviews without the full document content.
The result is as follows:
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.
On this page
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.