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.

インストール
パッケージは、available Packagist にあり、Composer 経由で次のコマンドを実行してインストールできます。
composer require groupdocscloud/groupdocs-annotation-cloud

要件
依存関係
SDK は次のパッケージを必要とします。
| Package | Constraint |
|---|
| guzzlehttp/guzzle | ^6.5.8 or ^7.4.5 |
| ext-curl | * |
| ext-json | * |
| ext-mbstring | * |
クイックスタート
API 認証情報を取得する
GroupDocs.Annotation Cloud を使用するには、GroupDocs.Cloud Dashboard でサインアップし、クライアント ID と クライアント シークレット を取得します。
API を初期化する
GroupDocs.Annotation Cloud SDK for PHP の使用を開始するには、次のコードを使用します。
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Get your ClientId and ClientSecret at https://dashboard.groupdocs.cloud
$configuration = new GroupDocs\Annotation\Configuration();
$configuration->setAppSid("YourClientId");
$configuration->setAppKey("YourClientSecret");
$configuration->setApiBaseUrl("https://api.groupdocs.cloud");
$annotateApi = new GroupDocs\Annotation\AnnotateApi($configuration);
完全な例は Utils.php を参照してください。
テキスト フィールド注釈を追加する
初期化したら、この基本的な例を使用して、GroupDocs Cloud に保存された Word ドキュメントにテキスト フィールド注釈を追加します。
<?php
require_once(__DIR__ . '/vendor/autoload.php');
use GroupDocs\Annotation\Model;
use GroupDocs\Annotation\Model\Requests;
$configuration = new GroupDocs\Annotation\Configuration();
$configuration->setAppSid("YourClientId");
$configuration->setAppKey("YourClientSecret");
$configuration->setApiBaseUrl("https://api.groupdocs.cloud");
$annotateApi = new GroupDocs\Annotation\AnnotateApi($configuration);
$a = new Model\AnnotationInfo();
$pt = new Model\Point();
$pt->setX(1);
$pt->setY(1);
$a->setAnnotationPosition($pt);
$box = new Model\Rectangle();
$box->setX(100);
$box->setY(100);
$box->setWidth(200);
$box->setHeight(100);
$a->setBox($box);
$a->setPageNumber(0);
$a->setFontColor(1201033);
$a->setFontSize(12);
$a->setOpacity(0.7);
$a->setType(Model\AnnotationInfo::TYPE_TEXT_FIELD);
$a->setText("Text field text");
$a->setCreatorName("Anonym A.");
$fileInfo = new Model\FileInfo();
$fileInfo->setFilePath("annotationdocs\\one-page.docx");
$options = new Model\AnnotateOptions();
$options->setFileInfo($fileInfo);
$options->setAnnotations([$a]);
$options->setOutputPath("Output\\output.docx");
$request = new Requests\annotateRequest($options);
$result = $annotateApi->annotate($request);
echo "Text field annotation added: " . $result->getHref() . "\n";
完全な例は AddTextFieldAnnotation.php を参照してください。
エリア注釈を追加する
この例では、Word ドキュメントにエリア注釈を追加します。
<?php
require_once(__DIR__ . '/vendor/autoload.php');
use GroupDocs\Annotation\Model;
use GroupDocs\Annotation\Model\Requests;
$configuration = new GroupDocs\Annotation\Configuration();
$configuration->setAppSid("YourClientId");
$configuration->setAppKey("YourClientSecret");
$configuration->setApiBaseUrl("https://api.groupdocs.cloud");
$annotateApi = new GroupDocs\Annotation\AnnotateApi($configuration);
$a = new Model\AnnotationInfo();
$pt = new Model\Point();
$pt->setX(1);
$pt->setY(1);
$a->setAnnotationPosition($pt);
$box = new Model\Rectangle();
$box->setX(100);
$box->setY(100);
$box->setWidth(200);
$box->setHeight(100);
$a->setBox($box);
$a->setPageNumber(0);
$a->setPenColor(1201033);
$a->setPenStyle(Model\AnnotationInfo::PEN_STYLE_SOLID);
$a->setPenWidth(1);
$a->setOpacity(0.7);
$a->setType(Model\AnnotationInfo::TYPE_AREA);
$a->setText("This is area annotation");
$a->setCreatorName("Anonym A.");
$fileInfo = new Model\FileInfo();
$fileInfo->setFilePath("annotationdocs\\one-page.docx");
$options = new Model\AnnotateOptions();
$options->setFileInfo($fileInfo);
$options->setAnnotations([$a]);
$options->setOutputPath("Output\\output.docx");
$request = new Requests\annotateRequest($options);
$result = $annotateApi->annotate($request);
echo "Area annotation added: " . $result->getHref() . "\n";
完全な例は AddAreaAnnotation.php を参照してください。
注釈を削除する
この例では、ドキュメントから注釈 1、2、3 を削除します。
<?php
require_once(__DIR__ . '/vendor/autoload.php');
use GroupDocs\Annotation\Model;
use GroupDocs\Annotation\Model\Requests;
$configuration = new GroupDocs\Annotation\Configuration();
$configuration->setAppSid("YourClientId");
$configuration->setAppKey("YourClientSecret");
$configuration->setApiBaseUrl("https://api.groupdocs.cloud");
$annotateApi = new GroupDocs\Annotation\AnnotateApi($configuration);
$fileInfo = new Model\FileInfo();
$fileInfo->setFilePath("input\\input.docx");
$options = new Model\RemoveOptions();
$options->setFileInfo($fileInfo);
$options->setAnnotationIds([1, 2, 3]);
$options->setOutputPath("Output\\output.docx");
$request = new Requests\removeAnnotationsRequest($options);
$result = $annotateApi->removeAnnotations($request);
echo "Annotations deleted: " . $result->getHref() . "\n";
完全な例は DeleteAnnotations.php を参照してください。
サポートされているファイル形式を取得する
サポートされている注釈形式を取得します。
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$configuration = new GroupDocs\Annotation\Configuration();
$configuration->setAppSid("YourClientId");
$configuration->setAppKey("YourClientSecret");
$configuration->setApiBaseUrl("https://api.groupdocs.cloud");
$infoApi = new GroupDocs\Annotation\InfoApi($configuration);
$response = $infoApi->getSupportedFileFormats();
foreach ($response->getFormats() as $format) {
echo $format->getFileFormat() . " - " . $format->getExtension() . "\n";
}
完全な例は GetSupportedFormats.php を参照してください。
GitHub の例
GroupDocs.Annotation Cloud PHP Examples リポジトリには、以下をカバーするすぐに実行できるサンプルが含まれています。
| Category | Examples |
|---|
| 注釈の追加 | テキスト フィールド、エリア、矢印、距離、楕円、画像、リンク、ポイント、ポリライン、リソースの墨消し、波線、ハイライト、置換、取り消し線、下線、透かし。複数の注釈。直接注釈 |
| 注釈の管理 | 注釈の抽出、注釈の削除 |
| ドキュメント プレビュー | ページの取得、ページの削除 |
| 基本的な使い方 | サポートされている形式、ドキュメント情報 |
| ファイル、フォルダー、ストレージ | アップロード、ダウンロード、コピー、移動、削除。フォルダーとストレージの操作 |
サンプルの実行方法
- 例のリポジトリ をクローンするか、ダウンロードします。
Examples/Utils.php を編集し、ClientId と ClientSecret を設定します。Examples ディレクトリに移動します。composer update を実行します。php RunExamples.php を実行します。
詳細については、次のサイトをご覧ください。Getting Started.

タグ
Document Annotation API | PHP Cloud API | GroupDocs.Annotation Cloud | REST API | Text Field Annotation | Area Annotation | Remove Annotations | Highlight Annotation | Redaction | PDF Annotation | Word Annotation | Supported File Formats | Document Information | Cloud Storage | Secure API Access