GroupDocs.Comparison allows you to adjust the appearance of the output document.
By default, changes from the two input files (source and target files) are added to the output document and highlighted. Use the ShowInsertedContent and ShowDeletedContent properties to configure the content of the output file.
Use the LeaveGaps property to adjust the display of the output document, which replaces the changed content with empty lines. To use this property, activate the ShowInsertedContent and ShowDeletedContent properties.
Follow these steps to adjust the appearance of the output document:
Instantiate the Comparer object. Specify the source file path or stream.
Call the add() method. Specify the target file path or stream.
Instantiate the CompareOptions object. Set the ShowInsertedContent, ShowDeletedContent, and/or LeaveGaps properties.
Call the compare() method. Specify the CompareOptions object from the previous step.
The following code snippet shows how to get the desired result