Compare multiple documents with specific compare settings
Leave feedback
On this page
Note: This feature applies to Microsoft Word documents, Microsoft PowerPoint, and OpenDocument presentations.
Add several targets and set styling for inserted items.
import groupdocs.comparison as gc
with gc.Comparer("source.docx") as comparer:
comparer.add("target1.docx")
comparer.add("target2.docx")
comparer.add("target3.docx")
options = gc.CompareOptions()
options.inserted_item_style = gc.StyleSettings(font_color=gc.Color.from_name("yellow"))
comparer.compare("result.docx", options)
🔹 Use case: Aggregate changes across multiple proposal iterations into a single consolidated diff.
Perform the same operation using streams.
import groupdocs.comparison as gc
with open("source.docx", "rb") as src,
open("target1.docx", "rb") as t1,
open("target2.docx", "rb") as t2,
open("target3.docx", "rb") as t3:
with gc.Comparer(src) as comparer:
comparer.add(t1)
comparer.add(t2)
comparer.add(t3)
options = gc.CompareOptions()
options.inserted_item_style = gc.StyleSettings(font_color=gc.Color.from_name("yellow"))
with open("result.docx", "wb") as out_stream:
comparer.compare(out_stream, options)
🔹 Use case: Compare multiple contributions uploaded via API without persisting intermediate files.
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.