Highlighting change text or data


#1

Hi,

I was wondering if there is any option to highlight the comparison result items such as in the following way:

image.png (2.8 KB)

Kind Regards,

Muhammad


#2

@muhammad555,

Thank you for you inquiry. We are investigating this scenario at our end. As we have any update on it, you shall be notified.


#3

@muhammad555,

API only allows you to change items style for deleted, inserted or style changed elements in the resultant file. Using ComparisonSettings you can set/define style of modified elements. If element is not modified, it (style) will be same as in source and target documents. Highlighting the text is not supported by the API.
Code example to set style for modified elements/items:

ComparisonSettings cs = new ComparisonSettings();
//use this to set style of deleted elements 
cs.DeletedItemsStyle.Color = Color.DarkRed;
cs.DeletedItemsStyle.Bold = true;
cs.DeletedItemsStyle.StrikeThrough = true;
cs.DeletedItemsStyle.Italic = true;
                
//use this to set style of inserted elements 
cs.InsertedItemsStyle.Color = Color.Blue;
cs.InsertedItemsStyle.Bold = true;
cs.InsertedItemsStyle.StrikeThrough = true;
cs.InsertedItemsStyle.Italic = true;
                
//use this to set style of style changed elements 
cs.StyleChangedItemsStyle.Color = Color.Green;
cs.StyleChangedItemsStyle.Bold = true;
cs.StyleChangedItemsStyle.StrikeThrough = true;
cs.StyleChangedItemsStyle.Italic = true;

You can also explore this documentation for further details.


#4

@atirtahir3,

Thank you for informing me. Example code is very helpful and it will be very nice feature if you guys add highlighting in future.


#5

@muhammad555,

You are welcome.

We are further investigating this scenario. Can you please tell for what specific formats (DOCX, PDF etc) you want this feature?


#6

@atirtahir3,

It will be good if this feature is available for these two (DOCX and PDF) formats.


#7

@muhammad555,

We shall investigate this and update you as we have any update.


#8

@muhammad555,

You can now highlight comparison results using latest version of the API that is 18.8.0.

settings.InsertedItemsStyle.HighlightColor = System.Drawing.Color.Red;
settings.DeletedItemsStyle.HighlightColor = System.Drawing.Color.Blue;
settings.StyleChangedItemsStyle.HighlightColor = System.Drawing.Color.Green;

Please follow release notes in order to see further changes.