GroupDocs.Comparison allows you to compare and customize the visibility of revisions in the output document.
Revision is a collection of changes received when comparing documents using built-in Word tools.
By default, the visibility of revisions is enabled. The following code snippet shows how to disable the visibility of revisions:
'use strict';// Import the GroupDocs Comparison Node.js SDK
constgroupdocs=require('@groupdocs/groupdocs.comparison');// Define file paths for source, target, and result 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 that will be compared against the source
comparer.add(targetPath);// Set up comparison options
constoptions=newgroupdocs.CompareOptions();// Disable revision marks in the output document
options.setShowRevisions(false);// Perform the comparison and write the result to the output file
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 disables the display of revision marks by setting setShowRevisions(false). When the comparison is performed, the result document will not show revision marks, displaying the final content directly without revision tracking indicators.
The result is as follows:
Closed state
Open state
Disable display Revisions
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.