Show gap lines instead of changes
Leave feedback
On this page
GroupDocs.Comparison for Python via .NET lets you adjust the output appearance by replacing changed content with empty lines.
Disable inserted/deleted content in the result and leave gaps where changes occurred.
import groupdocs.comparison as gc
with gc.Comparer("source.docx") as comparer:
comparer.add("target.docx")
options = gc.CompareOptions()
options.show_inserted_content = False
options.show_deleted_content = False
options.leave_gaps = True
comparer.compare("result.docx", options)
🔹 Use case: Provide redacted-style diffs that keep layout alignment without showing actual changed text.
The result is as follows:
Default result | Result without LeaveGaps property |
---|---|
![]() | ![]() |
Default result | Result with LeaveGaps property |
---|---|
![]() | ![]() |
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.