If so you can download any of the below versions for testing. The product will function as normal except for an evaluation limitation. At the time of purchase we provide a license file via email that will allow the product to work in its full capacity. If you would also like an evaluation license to test without any restrictions for 30 days, please follow the directions provided here.
If you experience errors, when you try to download a file, make sure your network policies (enforced by your company or ISP) allow downloading ZIP and/or MSI files.

Установка
Пакет доступен на npmjs.com и может быть установлен через npm следующей командой:
npm install groupdocs-comparison-cloud

Требования
Зависимости
SDK требует следующие пакеты:
| Package | Constraint |
|---|
| axios | ^1.16.1 |
| form-data | * |
| jsonwebtoken | 9.0.1 |
| qs | 6.15.2 |
Быстрый старт
Получите учетные данные API
Чтобы использовать GroupDocs.Comparison Cloud, зарегистрируйтесь на GroupDocs.Cloud Dashboard и получите Client ID и Client Secret.
Инициализируйте API
Используйте следующий код, чтобы начать использовать GroupDocs.Comparison Cloud SDK for Node.js.
"use strict";
const comparison_cloud = require("groupdocs-comparison-cloud");
const clientId = "YourClientId";
const clientSecret = "YourClientSecret";
const config = new comparison_cloud.Configuration(clientId, clientSecret);
config.apiBaseUrl = "https://api.groupdocs.cloud";
const compareApi = comparison_cloud.CompareApi.fromConfig(config);
Полный пример см. в RunExamples.js.
Сравнить два документа
После инициализации используйте этот базовый пример, чтобы сравнить два документа Word и сохранить результат.
"use strict";
const comparison_cloud = require("groupdocs-comparison-cloud");
const clientId = "YourClientId";
const clientSecret = "YourClientSecret";
const config = new comparison_cloud.Configuration(clientId, clientSecret);
config.apiBaseUrl = "https://api.groupdocs.cloud";
const compareApi = comparison_cloud.CompareApi.fromConfig(config);
(async () => {
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 options = new comparison_cloud.ComparisonOptions();
options.sourceFile = source;
options.targetFiles = [target];
options.outputPath = "output/result.docx";
let request = new comparison_cloud.ComparisonsRequest(options);
let response = await compareApi.comparisons(request);
console.log("Output file link: " + response.href);
})();
Полный пример см. в CompareDocuments.js.
Получить список изменений
Этот пример возвращает изменения между двумя документами Word.
"use strict";
const comparison_cloud = require("groupdocs-comparison-cloud");
const clientId = "YourClientId";
const clientSecret = "YourClientSecret";
const config = new comparison_cloud.Configuration(clientId, clientSecret);
config.apiBaseUrl = "https://api.groupdocs.cloud";
const compareApi = comparison_cloud.CompareApi.fromConfig(config);
(async () => {
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 options = new comparison_cloud.ComparisonOptions();
options.sourceFile = source;
options.targetFiles = [target];
options.outputPath = "output/result.docx";
let request = new comparison_cloud.PostChangesRequest(options);
let changes = await compareApi.postChanges(request);
console.log("Changes count: " + changes.length);
})();
Полный пример см. в GetListOfChanges.js.
Получить сведения о документе
Этот пример возвращает число страниц исходного документа.
"use strict";
const comparison_cloud = require("groupdocs-comparison-cloud");
const clientId = "YourClientId";
const clientSecret = "YourClientSecret";
const config = new comparison_cloud.Configuration(clientId, clientSecret);
config.apiBaseUrl = "https://api.groupdocs.cloud";
const infoApi = comparison_cloud.InfoApi.fromConfig(config);
(async () => {
let fileInfo = new comparison_cloud.FileInfo();
fileInfo.filePath = "source_files/word/source.docx";
let request = new comparison_cloud.GetDocumentInfoRequest(fileInfo);
let response = await infoApi.getDocumentInfo(request);
console.log("GetDocumentInformation completed: " + response.pageCount);
})();
Полный пример см. в GetDocumentInformation.js.
Получить поддерживаемые форматы сравнения
Получите форматы документов, которые API может сравнивать.
"use strict";
const comparison_cloud = require("groupdocs-comparison-cloud");
const clientId = "YourClientId";
const clientSecret = "YourClientSecret";
const config = new comparison_cloud.Configuration(clientId, clientSecret);
config.apiBaseUrl = "https://api.groupdocs.cloud";
const infoApi = comparison_cloud.InfoApi.fromConfig(config);
(async () => {
let response = await infoApi.getSupportedFileFormats();
console.log("Formats count: " + response.formats.length);
})();
Полный пример см. в GetSupportedFormats.js.
Примеры на GitHub
Репозиторий GroupDocs.Comparison Cloud Node.js Examples содержит готовые к запуску примеры:
| Category | Examples |
|---|
| Basic Usage | Сравнение документов, сравнение документов PDF, сведения о документе, поддерживаемые форматы, предварительный просмотр, расход лицензии |
| Advanced Usage | Несколько документов, защищенные документы, чувствительность, стили изменений, список изменений, редакции, параметры сохранения |
Как запустить примеры
- Клонируйте или скачайте репозиторий примеров
- Отредактируйте
Examples/RunExamples.js и задайте clientId и clientSecret - Перейдите в каталог
Examples - Выполните
npm install - Выполните
npm update - Выполните
npm run-script start
Подробности см. в разделе Getting Started.

Document Comparison API | Node.js Cloud API | GroupDocs.Comparison Cloud | REST API | Document Comparison | Folder Comparison | Revision Control | Track Changes | Preview Generation | Multi-format Support | Password Protected Documents | Source Code Comparison | Change Tracking | Customization | Document Merging | Change Coordinates | Metadata Extraction | Document Security | Document Review | Secure API Access | Cloud Storage Integration | Cross-platform API