Set shape color independently of font color
Leave feedback
On this page
GroupDocs.Comparison provides the option to specify the color for changed shapes.
To compare two documents with custom change color for shapes, follow these steps:
- Instantiate the Comparer object. Specify the source document path or stream.
- Call the Add method. Specify the target document path or stream.
- Instantiate the CompareOptions object. Specify the ShapeColor for the InsertedItemStyle/DeletedItemStyle/ChangedItemStyle parameters.
- Set MarkChangedContent to true.
- Call the Comparer method. Specify the CompareOptions object.
The following code snippets show how to compare documents with specific color options for shapes:
using GroupDocs.Comparison;
using GroupDocs.Comparison.Options;
// ...
using (Comparer comparer = new Comparer("source.docx"))
{
comparer.Add("target.docx");
CompareOptions compareOptions = new CompareOptions()
{
DetectStyleChanges = true,
MarkChangedContent = true,
InsertedItemStyle = new StyleSettings()
{
FontColor = System.Drawing.Color.Blue,
ShapeColor = System.Drawing.Color.Purple
},
DeletedItemStyle = new StyleSettings()
{
FontColor = System.Drawing.Color.Red,
ShapeColor = System.Drawing.Color.Orange
},
ChangedItemStyle = new StyleSettings()
{
FontColor = System.Drawing.Color.Green,
ShapeColor = System.Drawing.Color.LightGreen
}
}
comparer.Compare("result.docx", compareOptions);
}
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.