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.

安装
此包在 nuget.org 上提供,可通过包管理器控制台执行以下命令安装:
NuGet\Install-Package GroupDocs.Annotation-Cloud

要求
快速入门
获取 API 凭据
要使用 GroupDocs.Annotation Cloud,请在 GroupDocs.Cloud 仪表板 注册并获取 Client ID 和 Client Secret。
初始化 API
使用以下代码开始使用 GroupDocs.Annotation Cloud SDK for .NET。
using GroupDocs.Annotation.Cloud.Sdk.Api;
using GroupDocs.Annotation.Cloud.Sdk.Client;
string MyClientId = "YourClientId";
string MyClientSecret = "YourClientSecret";
var config = new Configuration(MyClientId, MyClientSecret);
config.ApiBaseUrl = "https://api.groupdocs.cloud";
var apiInstance = new AnnotateApi(config);
完整示例见 Constants.cs。
添加文本高亮
此示例向云存储中的 Word 文档添加文本高亮。
using System;
using System.Collections.Generic;
using System.Linq;
using GroupDocs.Annotation.Cloud.Sdk.Api;
using GroupDocs.Annotation.Cloud.Sdk.Client;
using GroupDocs.Annotation.Cloud.Sdk.Model;
using GroupDocs.Annotation.Cloud.Sdk.Model.Requests;
var config = new Configuration("YourClientId", "YourClientSecret");
config.ApiBaseUrl = "https://api.groupdocs.cloud";
var apiInstance = new AnnotateApi(config);
var options = new AnnotateOptions
{
FileInfo = new FileInfo { FilePath = "one-page.docx" },
Annotations = new List<AnnotationInfo>
{
new AnnotationInfo
{
Points = new List<Point>
{
new Point { X = 80, Y = 730 }, new Point { X = 240, Y = 730 },
new Point { X = 80, Y = 650 }, new Point { X = 240, Y = 650 }
},
BackgroundColor = 65535,
PageNumber = 0,
Type = AnnotationInfo.TypeEnum.TextHighlight,
Text = "This is text highlight annotation",
CreatorName = "Anonym A."
}
},
OutputPath = "Output/output.docx"
};
var link = apiInstance.Annotate(new AnnotateRequest(options));
Console.WriteLine("AddTextHighlightAnnotation: Text highlight Annotation added: " + link.Title);
完整示例见 AddTextHighlightAnnotation.cs。
添加区域批注
此示例在第一页添加区域批注。
using System.Collections.Generic;
using System.Linq;
using GroupDocs.Annotation.Cloud.Sdk.Api;
using GroupDocs.Annotation.Cloud.Sdk.Client;
using GroupDocs.Annotation.Cloud.Sdk.Model;
using GroupDocs.Annotation.Cloud.Sdk.Model.Requests;
var config = new Configuration("YourClientId", "YourClientSecret");
config.ApiBaseUrl = "https://api.groupdocs.cloud";
var apiInstance = new AnnotateApi(config);
var options = new AnnotateOptions
{
FileInfo = new FileInfo { FilePath = "one-page.docx" },
Annotations = new List<AnnotationInfo>
{
new AnnotationInfo
{
AnnotationPosition = new Point { X = 1, Y = 1 },
Box = new Rectangle { X = 100, Y = 100, Width = 100, Height = 100 },
PageNumber = 0,
Type = AnnotationInfo.TypeEnum.Area,
Text = "This is area annotation",
CreatorName = "Anonym A."
}
},
OutputPath = "Output/output.docx"
};
var link = apiInstance.Annotate(new AnnotateRequest(options));
Console.WriteLine("AddAreaAnnotation: Area Annotation added: " + link.Title);
完整示例见 AddAreaAnnotation.cs。
删除批注
此示例删除批注 1、2 和 3。
using System.Collections.Generic;
using GroupDocs.Annotation.Cloud.Sdk.Api;
using GroupDocs.Annotation.Cloud.Sdk.Client;
using GroupDocs.Annotation.Cloud.Sdk.Model;
using GroupDocs.Annotation.Cloud.Sdk.Model.Requests;
var config = new Configuration("YourClientId", "YourClientSecret");
config.ApiBaseUrl = "https://api.groupdocs.cloud";
var apiInstance = new AnnotateApi(config);
var options = new RemoveOptions
{
FileInfo = new FileInfo { FilePath = "one-page.docx" },
AnnotationIds = new List<int?> { 1, 2, 3 },
OutputPath = "Output/output.docx"
};
var link = apiInstance.RemoveAnnotations(new RemoveAnnotationsRequest(options));
Console.WriteLine("DeleteAnnotations: Annotations deleted: " + link.Title);
完整示例见 DeleteAnnotations.cs。
提取批注
此示例读取文档中的批注。
using GroupDocs.Annotation.Cloud.Sdk.Api;
using GroupDocs.Annotation.Cloud.Sdk.Client;
using GroupDocs.Annotation.Cloud.Sdk.Model;
using GroupDocs.Annotation.Cloud.Sdk.Model.Requests;
var config = new Configuration("YourClientId", "YourClientSecret");
config.ApiBaseUrl = "https://api.groupdocs.cloud";
var apiInstance = new AnnotateApi(config);
var response = apiInstance.Extract(new ExtractRequest(new FileInfo { FilePath = "input.docx" }));
Console.WriteLine("ExtractAnnotations: annotations count = " + response.Count);
完整示例见 ExtractAnnotations.cs。
获取支持的文件格式
获取 annotation API 接受的格式。
using GroupDocs.Annotation.Cloud.Sdk.Api;
using GroupDocs.Annotation.Cloud.Sdk.Client;
var config = new Configuration("YourClientId", "YourClientSecret");
config.ApiBaseUrl = "https://api.groupdocs.cloud";
var apiInstance = new InfoApi(config);
var response = apiInstance.GetSupportedFileFormats();
Console.WriteLine("GetSupportedFormats: formats count = " + response.Formats.Count);
完整示例见 GetSupportedFormats.cs。
GitHub 上的示例
GroupDocs.Annotation Cloud .NET Examples 仓库包含可直接运行的示例,涵盖:
| Category | Examples |
|---|
| 添加 | 区域、箭头、距离、椭圆、图像、链接、点、折线、文本高亮、下划线、删除线、遮盖、水印 |
| 管理 | 删除批注、提取批注、直接批注 |
| Info | 文档信息、支持的格式 |
| 预览 | 获取页面、删除页面 |
如何运行示例
- 克隆或下载 示例仓库
- 在 Visual Studio 2017 或更高版本中打开
Examples/GroupDocs.Annotation.Cloud.Examples.sln - 右键单击解决方案并选择 Enable NuGet Package Restore
- 编辑
Examples/GroupDocs.Annotation.Cloud.Examples/Program.cs,设置 Constants.MyClientId 和 Constants.MyClientSecret - 生成并运行
更多细节请参阅 Getting Started。
