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.

インストール
パッケージは rubygems.org で入手できます。次のコマンドを実行して gem でインストールできます。
gem install groupdocs_annotation_cloud

要件
依存関係
SDK には次の gem が必要です。
| Package | Constraint |
|---|
| addressable | ~> 2.8.4, >= 2.8.4 |
| faraday | ~> 0.14.0 |
クイックスタート
API 認証情報を取得する
GroupDocs.Annotation Cloud を使用するには、GroupDocs.Cloud Dashboard で登録し、Client ID と Client Secret を取得します。
API を初期化する
GroupDocs.Annotation Cloud SDK for Ruby の使用を開始するには、次のコードを使用します。
require 'groupdocs_annotation_cloud'
# Get your ClientId and ClientSecret at https://dashboard.groupdocs.cloud
client_id = "YourClientId"
client_secret = "YourClientSecret"
config = GroupDocsAnnotationCloud::Configuration.new(client_id, client_secret)
config.api_base_url = "https://api.groupdocs.cloud"
api = GroupDocsAnnotationCloud::AnnotateApi.from_config(config)
完全な例は RunExamples.rb を参照してください。
テキストフィールド注釈を追加する
初期化したら、この基本例を使って Word 文書にテキストフィールド注釈を追加します。
require 'groupdocs_annotation_cloud'
client_id = "YourClientId"
client_secret = "YourClientSecret"
config = GroupDocsAnnotationCloud::Configuration.new(client_id, client_secret)
config.api_base_url = "https://api.groupdocs.cloud"
$api = GroupDocsAnnotationCloud::AnnotateApi.from_config(config)
$a1 = GroupDocsAnnotationCloud::AnnotationInfo.new
$a1.annotation_position = GroupDocsAnnotationCloud::Point.new
$a1.annotation_position.x = 1
$a1.annotation_position.y = 1
$a1.box = GroupDocsAnnotationCloud::Rectangle.new
$a1.box.x = 100
$a1.box.y = 100
$a1.box.width = 200
$a1.box.height = 100
$a1.page_number = 0
$a1.font_color = 1201033
$a1.font_size = 12
$a1.opacity = 0.7
$a1.type = "TextField"
$a1.text = "Text field text"
$a1.creator_name = "Anonym A."
file_info = GroupDocsAnnotationCloud::FileInfo.new()
file_info.file_path = "annotationdocs\\one-page.docx"
options = GroupDocsAnnotationCloud::AnnotateOptions.new()
options.file_info = file_info
options.annotations = [$a1]
options.output_path = "Output/output.docx"
$request = GroupDocsAnnotationCloud::AnnotateRequest.new(options)
result = $api.annotate($request)
puts("AddTextFieldAnnotation: Text Field Annotation added: " + result.href)
完全な例は AddTextFieldAnnotation.rb を参照してください。
エリア注釈を追加する
この例は Word 文書にエリア注釈を追加します。
require 'groupdocs_annotation_cloud'
client_id = "YourClientId"
client_secret = "YourClientSecret"
config = GroupDocsAnnotationCloud::Configuration.new(client_id, client_secret)
config.api_base_url = "https://api.groupdocs.cloud"
$api = GroupDocsAnnotationCloud::AnnotateApi.from_config(config)
$a1 = GroupDocsAnnotationCloud::AnnotationInfo.new
$a1.annotation_position = GroupDocsAnnotationCloud::Point.new
$a1.annotation_position.x = 1
$a1.annotation_position.y = 1
$a1.box = GroupDocsAnnotationCloud::Rectangle.new
$a1.box.x = 100
$a1.box.y = 100
$a1.box.width = 200
$a1.box.height = 100
$a1.page_number = 0
$a1.pen_color = 1201033
$a1.pen_style = "Solid"
$a1.pen_width = 1
$a1.opacity = 0.7
$a1.type = "Area"
$a1.text = "This is area annotation"
$a1.creator_name = "Anonym A."
file_info = GroupDocsAnnotationCloud::FileInfo.new()
file_info.file_path = "annotationdocs\\one-page.docx"
options = GroupDocsAnnotationCloud::AnnotateOptions.new()
options.file_info = file_info
options.annotations = [$a1]
options.output_path = "Output/output.docx"
$request = GroupDocsAnnotationCloud::AnnotateRequest.new(options)
result = $api.annotate($request)
puts("AddAreaAnnotation: Area Annotation added: " + result.href)
完全な例は AddAreaAnnotation.rb を参照してください。
注釈を抽出する
この例は文書に保存されている注釈を返します。
require 'groupdocs_annotation_cloud'
client_id = "YourClientId"
client_secret = "YourClientSecret"
config = GroupDocsAnnotationCloud::Configuration.new(client_id, client_secret)
config.api_base_url = "https://api.groupdocs.cloud"
$api = GroupDocsAnnotationCloud::AnnotateApi.from_config(config)
file_info = GroupDocsAnnotationCloud::FileInfo.new()
file_info.file_path = "annotationdocs\\input.docx"
$request = GroupDocsAnnotationCloud::ExtractRequest.new(file_info)
$response = $api.extract($request)
puts("ExtractAnnotations: annotations count = " + $response.length.to_s)
完全な例は ExtractAnnotations.rb を参照してください。
注釈を削除する
この例は文書から注釈 1, 2, 3 を削除します。
require 'groupdocs_annotation_cloud'
client_id = "YourClientId"
client_secret = "YourClientSecret"
config = GroupDocsAnnotationCloud::Configuration.new(client_id, client_secret)
config.api_base_url = "https://api.groupdocs.cloud"
$api = GroupDocsAnnotationCloud::AnnotateApi.from_config(config)
file_info = GroupDocsAnnotationCloud::FileInfo.new()
file_info.file_path = "annotationdocs\\input.docx"
options = GroupDocsAnnotationCloud::RemoveOptions.new()
options.file_info = file_info
options.annotation_ids = [1, 2, 3]
options.output_path = "Output/output.docx"
$request = GroupDocsAnnotationCloud::RemoveAnnotationsRequest.new(options)
$response = $api.remove_annotations($request)
puts("RemoveAnnotations: Annotations deleted from document: " + $response.href)
完全な例は RemoveAnnotations.rb を参照してください。
対応している注釈形式を取得する
API が注釈を付けられる文書形式を取得します。
require 'groupdocs_annotation_cloud'
client_id = "YourClientId"
client_secret = "YourClientSecret"
config = GroupDocsAnnotationCloud::Configuration.new(client_id, client_secret)
config.api_base_url = "https://api.groupdocs.cloud"
$api = GroupDocsAnnotationCloud::InfoApi.from_config(config)
$response = $api.get_supported_file_formats()
puts("GetSupportedFormats: formats count = " + $response.formats.length.to_s)
完全な例は GetSupportedFormats.rb を参照してください。
GitHub のサンプル
GroupDocs.Annotation Cloud Ruby Examples リポジトリには、次を扱う実行可能なサンプルが含まれています。
| Category | Examples |
|---|
| Add Annotation | テキストフィールド, ハイライト, 下線, 取り消し線, 波線, 置換, 墨消し, エリア, 矢印, 距離, 楕円, 画像, リンク, 点, ポリライン, 透かし |
| Extract and Remove | 注釈の抽出, ID による注釈の削除 |
| Preview | ページの取得, ページの削除 |
| Basic Usage | 文書情報, 対応形式, ファイル, フォルダー, ストレージの操作 |
サンプルの実行方法
- サンプルリポジトリ をクローンまたはダウンロードします
Examples/RunExamples.rb を編集し、client_id と client_secret を設定しますExamples ディレクトリに移動しますgem install groupdocs_annotation_cloud を実行しますruby RunExamples.rb を実行します
詳細は Getting Started を参照してください。

Document Annotation API | Ruby Cloud API | GroupDocs.Annotation Cloud | REST API | Text Annotation | Area Annotation | Highlight Annotation | Remove Annotations | Extract Annotations | Document Information | Cloud Storage Integration | Secure API Access