製品を閲覧する

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.


Product Docs Swagger Examples Blog Support Dashboard

インストール

パッケージは npmjs.com で入手できます。次のコマンドを実行して npm でインストールできます。

npm install groupdocs-comparison-cloud

NPM Version NPM Downloads NPM-GroupDocsCloud


要件

依存関係

SDK には次のパッケージが必要です。

PackageConstraint
axios^1.16.1
form-data*
jsonwebtoken9.0.1
qs6.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 を参照してください。

2 つの文書を比較する

初期化したら、この基本例を使って 2 つの 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 を参照してください。

変更の一覧を取得する

この例は 2 つの 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 リポジトリには、次を扱う実行可能なサンプルが含まれています。

CategoryExamples
Basic Usage文書の比較, PDF 文書の比較, 文書情報, 対応形式, プレビュー, ライセンス消費
Advanced Usage複数文書, 保護された文書, 感度, 変更スタイル, 変更一覧, リビジョン, 保存オプション

サンプルの実行方法

  1. サンプルリポジトリ をクローンまたはダウンロードします
  2. Examples/RunExamples.js を編集し、clientId と clientSecret を設定します
  3. Examples ディレクトリに移動します
  4. npm install を実行します
  5. npm update を実行します
  6. npm run-script start を実行します

詳細は Getting Started を参照してください。


Product Docs Swagger Examples Blog Support Dashboard


Tags

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



 日本