Get changes coordinates


GroupDocs.Comparison Cloud allows to detect changes between source and target files and obtain changes coordinates at files preview images.

The following code sample shows how to get changes coordinates.

API Usage

There are steps that usage of GroupDocs.Comparison Cloud consists of:

  1. Upload input documents into cloud storage
  2. Compare documents or get document info
  3. Download comparison result document from storage

Steps 1 and 3 are storage operations, please refer to this File API documentation for usage details.

Swagger UI lets you call this REST API directly from the browser.

cURL REST Example

* First get JSON Web Token
* Please get your App Key and App SID from Kindly place App Key in "client_secret" and App SID in "client_id" argument.
curl -v "" \
-d "grant_type#client_credentials&client_id#xxxx&client_secret#xxxx" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"

* cURL example to get document information
curl -v "" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer <jwt token>"
-d "{
  'SourceFile': {
    'FilePath': 'source_files\\word\\source.docx'
  'TargetFiles': [
      'FilePath': 'target_files\\word\\target.docx'
  'Settings': {
    'CalculateComponentCoordinates': true

    "id": 0,
    "comparisonAction": "None",
    "type": "Inserted",
    "text": "lol",
    "targetText": "Latin (i/?læt?n/, /?læt?n/; Latin: lingua lat?na, IPA: [?l????a la?ti?na]) is a classical language, originally spoken inLatium, Italy, which belongs to the Italic branch of the Indo-European languages.[3] The Latin alphabet is derived from the Etruscan and Greek alphabetslol.",
    "authors": [
    "styleChangeInfo": [],
    "pageInfo": {
      "width": 612,
      "height": 792,
      "pageNumber": 1
    "box": {
      "height": 16.0934353,
      "width": 14.0021219,
      "x": 388.503021,
      "y": 115.730377


Using an SDK (API client) is the quickest way for a developer to speed up the development. An SDK takes care of a lot of low-level details of making requests and handling responses and lets you focus on writing code specific to your particular project. Check out our GitHub repository for a complete list of GroupDocs.Comparison Cloud SDKs along with working examples, to get you started in no time. Please check Available SDKs article to learn how to add an SDK to your project.

SDK Examples

// For complete examples and data files, please go to
string MyAppKey = ""; // Get AppKey and AppSID from
string MyAppSid = ""; // Get AppKey and AppSID from

var configuration = new Configuration(MyAppSid, MyAppKey);

var apiInstance = new CompareApi(configuration);
var options = new ComparisonOptions
    SourceFile = new FileInfo
        FilePath = "source_files/word/source.docx"
    TargetFiles = new List<FileInfo> {
        new FileInfo {
            FilePath = "target_files/word/target.docx"
    Settings = new Settings
        CalculateComponentCoordinates = true

var request = new PostChangesRequest(options);
var changes = apiInstance.PostChanges(request);

// For complete examples and data files, please go to
String MyAppKey = ""; // Get AppKey and AppSID from
String MyAppSid = ""; // Get AppKey and AppSID from

Configuration configuration = new Configuration(MyAppSid, MyAppKey);

CompareApi apiInstance = new CompareApi(configuration);

FileInfo sourceFileInfo = new FileInfo();
FileInfo targetFileInfo = new FileInfo();

Settings settings = new Settings();

ComparisonOptions options = new ComparisonOptions();

PostChangesRequest request = new PostChangesRequest(options);
List<ChangeInfo> changes = apiInstance.postChanges(request);

// For complete examples and data files, please go to
use GroupDocs\Comparison\Model;
use GroupDocs\Comparison\Model\Requests;

$AppSid = ""; // Get AppKey and AppSID from
$AppKey = ""; // Get AppKey and AppSID from

$configuration = new GroupDocs\Comparison\Configuration();

$apiInstance# new GroupDocs\Comparison\CompareApi($configuration);

$sourceFile = new Model\FileInfo();
$targetFile = new Model\FileInfo();
$options = new Model\UpdatesOptions();
$settings = new Model\Settings();

$changes = $apiInstance->postChanges(new Requests\PostChangesRequest($options));

// For complete examples and data files, please go to
global.comparison_cloud = require("groupdocs-comparison-cloud");

global.appSid = "XXXX-XXXX-XXXX-XXXX"; // Get AppKey and AppSID from
global.appKey = "XXXXXXXXXXXXXXXX"; // Get AppKey and AppSID from

global.compareApi = comparison_cloud.CompareApi.fromKeys(appSid, appKey);

let source = new comparison_cloud.FileInfo();
source.filePath = "source_files/word/source.docx";
let target = new comparison_cloud.FileInfo();
target.filePath = "target_files/word/target.docx";
let settings = new comparison_cloud.Settings();
settings.calculateComponentCoordinates = true;
let options = new comparison_cloud.ComparisonOptions();
options.sourceFile = source;
options.targetFiles = [target];
options.outputPath = "output/result.docx";
options.settings = settings;

let request = new comparison_cloud.PostChangesRequest(options);
let changes = await compareApi.postChanges(request);

# For complete examples and data files, please go to
import groupdocs_comparison_cloud

app_sid = "XXXX-XXXX-XXXX-XXXX" # Get AppKey and AppSID from
app_key = "XXXXXXXXXXXXXXXX" # Get AppKey and AppSID from

api_instance = groupdocs_comparison_cloud.CompareApi.from_keys(app_sid, app_key)

source = groupdocs_comparison_cloud.FileInfo()
source.file_path = "source_files/word/source.docx"
target = groupdocs_comparison_cloud.FileInfo()
target.file_path = "target_files/word/target.docx"
options = groupdocs_comparison_cloud.ComparisonOptions()
options.source_file = source
options.target_files = [target]
options.output_path = "output/result.docx"
settings = groupdocs_comparison_cloud.Settings()
settings.calculate_component_coordinates = True
options.settings = settings

changes = api_instance.post_changes(groupdocs_comparison_cloud.PostChangesRequest(options))

# For complete examples and data files, please go to
require 'groupdocs_comparison_cloud'

$app_sid = "XXXX-XXXX-XXXX-XXXX" # Get AppKey and AppSID from
$app_key = "XXXXXXXXXXXXXXXX" # Get AppKey and AppSID from

api_instance = GroupDocsComparisonCloud::CompareApi.from_keys($app_sid, $app_key)

source =
source.file_path = "source_files/word/source.docx"
target =
target.file_path = "target_files/word/target.docx"
options =
options.source_file = source
options.target_files = [target]
options.output_path = "output/result.docx"
settings =
settings.calculate_component_coordinates = 100
options.settings = settings

request =
changes = apiInstance.post_changes(request)