Setting author of changes

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Comparison MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-comparison -- dnx GroupDocs.Comparison.Mcp --yes
Folders, licensing and more →

On this page

GroupDocs.Comparison allows you to set author of changes name in the resulting document. To do this, follow these steps:

  1. Instantiate the Comparer object. Specify a source file path or an input stream.
  2. Call the add method. Specify a target file path or an input stream.
  3. Instantiate the CompareOptions object. Set the WordTrackChanges and ShowRevisions properties to true.
  4. Set author of changes by changing the RevisionAuthorName property.
  5. Call the compare method. Specify the CompareOptions object from previous step.

The following code snippet shows how to change author of changes:

import com.groupdocs.comparison.Comparer;
import com.groupdocs.comparison.options.CompareOptions;
// ...

try (Comparer comparer = new Comparer("source.docx")) {
    comparer.add("target.docx");

    CompareOptions compareOptions = new CompareOptions();
    compareOptions.setShowRevisions(true);
    compareOptions.setWordTrackChanges(true);
    compareOptions.setRevisionAuthorName("New author");

    comparer.compare(resultPath, compareOptions);
}

The result is as follows:

Change author

On this page