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.editor-Cloud

要求
快速入门
获取 API 凭据
要使用 GroupDocs.Editor Cloud,请在 GroupDocs.Cloud 仪表板 注册并获取 Client ID 和 Client Secret。
初始化 API
使用以下代码开始使用 GroupDocs.Editor Cloud SDK for .NET。
using GroupDocs.Editor.Cloud.Sdk.Api;
using GroupDocs.Editor.Cloud.Sdk.Client;
string MyClientId = "YourClientId";
string MyClientSecret = "YourClientSecret";
var config = new Configuration(MyClientId, MyClientSecret);
var apiInstance = new EditApi(config);
完整示例见 Common.cs。
编辑 Word 文档
此示例加载受密码保护的 Word 文档、替换 HTML 中的文本并保存 DOCX 文件。
using System.IO;
using System.Text;
using GroupDocs.Editor.Cloud.Sdk.Api;
using GroupDocs.Editor.Cloud.Sdk.Client;
using GroupDocs.Editor.Cloud.Sdk.Model;
using GroupDocs.Editor.Cloud.Sdk.Model.Requests;
using FileInfo = GroupDocs.Editor.Cloud.Sdk.Model.FileInfo;
var config = new Configuration("YourClientId", "YourClientSecret");
var editApi = new EditApi(config);
var fileApi = new FileApi(config);
var loadOptions = new WordProcessingLoadOptions
{
FileInfo = new FileInfo
{
FilePath = "WordProcessing/password-protected.docx",
Password = "password"
},
OutputPath = "output"
};
var loadResult = editApi.Load(new LoadRequest(loadOptions));
var stream = fileApi.DownloadFile(new DownloadFileRequest(loadResult.HtmlPath));
var htmlString = new StreamReader(stream, Encoding.UTF8).ReadToEnd();
htmlString = htmlString.Replace("Sample test text", "Hello world");
fileApi.UploadFile(new UploadFileRequest(loadResult.HtmlPath, new MemoryStream(Encoding.UTF8.GetBytes(htmlString))));
var saveOptions = new WordProcessingSaveOptions
{
FileInfo = loadOptions.FileInfo,
OutputPath = "output/edited.docx",
HtmlPath = loadResult.HtmlPath,
ResourcesPath = loadResult.ResourcesPath
};
var saveResult = editApi.Save(new SaveRequest(saveOptions));
Console.WriteLine("Document edited: " + saveResult.Path);
完整示例见 EditWordProcessingDocument.cs。
编辑电子表格
此示例加载第一个工作表、替换文本并保存 XLSX 文件。
using System.IO;
using System.Text;
using GroupDocs.Editor.Cloud.Sdk.Api;
using GroupDocs.Editor.Cloud.Sdk.Client;
using GroupDocs.Editor.Cloud.Sdk.Model;
using GroupDocs.Editor.Cloud.Sdk.Model.Requests;
using FileInfo = GroupDocs.Editor.Cloud.Sdk.Model.FileInfo;
var config = new Configuration("YourClientId", "YourClientSecret");
var editApi = new EditApi(config);
var fileApi = new FileApi(config);
var loadOptions = new SpreadsheetLoadOptions
{
FileInfo = new FileInfo { FilePath = "Spreadsheet/four-sheets.xlsx" },
OutputPath = "output",
WorksheetIndex = 0
};
var loadResult = editApi.Load(new LoadRequest(loadOptions));
var stream = fileApi.DownloadFile(new DownloadFileRequest(loadResult.HtmlPath));
var htmlString = new StreamReader(stream, Encoding.UTF8).ReadToEnd();
htmlString = htmlString.Replace("This is sample sheet", "This is sample sheep");
fileApi.UploadFile(new UploadFileRequest(loadResult.HtmlPath, new MemoryStream(Encoding.UTF8.GetBytes(htmlString))));
var saveOptions = new SpreadsheetSaveOptions
{
FileInfo = loadOptions.FileInfo,
OutputPath = "output/edited.xlsx",
HtmlPath = loadResult.HtmlPath,
ResourcesPath = loadResult.ResourcesPath
};
var saveResult = editApi.Save(new SaveRequest(saveOptions));
Console.WriteLine("Document edited: " + saveResult.Path);
完整示例见 EditSpreadsheetDocument.cs。
获取文档信息
此示例返回受密码保护的 Word 文档的页数。
using GroupDocs.Editor.Cloud.Sdk.Api;
using GroupDocs.Editor.Cloud.Sdk.Client;
using GroupDocs.Editor.Cloud.Sdk.Model;
using GroupDocs.Editor.Cloud.Sdk.Model.Requests;
var config = new Configuration("YourClientId", "YourClientSecret");
var apiInstance = new InfoApi(config);
var request = new GetInfoRequest(new FileInfo
{
FilePath = "WordProcessing/password-protected.docx",
Password = "password"
});
var response = apiInstance.GetInfo(request);
Console.WriteLine("InfoResult.Pages.Count: " + response.PageCount);
完整示例见 GetDocumentInformation.cs。
获取支持的文件类型
获取 editor API 接受的格式。
using GroupDocs.Editor.Cloud.Sdk.Api;
using GroupDocs.Editor.Cloud.Sdk.Client;
var config = new Configuration("YourClientId", "YourClientSecret");
var apiInstance = new InfoApi(config);
var response = apiInstance.GetSupportedFileFormats();
foreach (var entry in response.Formats)
{
Console.WriteLine($"{entry.FileFormat}: {string.Join(",", entry.Extension)}");
}
完整示例见 GetSupportedFileTypes.cs。
GitHub 上的示例
GroupDocs.Editor Cloud .NET Examples 仓库包含可直接运行的示例,涵盖:
| Category | Examples |
|---|
| 编辑 | 文字处理、电子表格、演示文稿、带分隔符的文本、纯文本 |
| Info | 文档信息、支持的文件类型、许可证消耗 |
如何运行示例
- 克隆或下载 示例仓库
- 在 Visual Studio 2017 或更高版本中打开
Examples/GroupDocs.Editor.Cloud.Examples.CSharp.sln - 右键单击解决方案并选择 Enable NuGet Package Restore
- 编辑
Examples/GroupDocs.Editor.Cloud.Examples.CSharp/RunExamples.cs,设置 Common.MyClientId 和 Common.MyClientSecret - 生成并运行
更多细节请参阅 Getting Started。

标签
Document Editing API | .NET Cloud API | GroupDocs.Editor Cloud | REST API | Word Processing Formats | Spreadsheet Formats | Presentation Formats | Text Formats | CSV Files | DOCX Documents | XLSX Documents | PPTX Presentations | Password-Protected Files | Cloud Storage Integration | Document Info Retrieval | File Operations | API Explorer | Multi-Platform Support | SDK Support | Secure API Access