在 C# 中将 XLS 文件转换为 GIF
API
PUT
https://api.aspose.cloud/v3.0/cells/convert
将文件格式从 XLS 转换为 GIF 是一项复杂的任务。所有 XLS 到 GIF 格式的转换都由我们的 C# SDK 执行,同时保持源 XLS 电子表格的主要结构和逻辑内容。我们的 C# 库是在线将 XLS 文件转换为 GIF 文件的专业解决方案。此 Cloud SDK 为 C# 开发人员提供了强大的功能和完美的 GIF 输出。
C# 中的代码示例使用 REST API 将 XLS 转换为 GIF 格式
// For complete examples and data files, please go to https://github.com/aspose-cells-cloud/aspose-cells-cloud-dotnet/
string name = "Book1.xls";
string format = "gif";
string password = null;
string outPath = null;
string storageName = null;
string destFile = "Book1.gif";
CellsApi cellsApi = new CellsApi(Environment.GetEnvironmentVariable("ProductClientId"), Environment.GetEnvironmentVariable("ProductClientSecret"));
using (Stream stream = cellsApi.CellsWorkbookPutConvertWorkbook(File.OpenRead(name), format, password, outPath, storageName))
{
using (Stream outStream = File.OpenWrite(destFile))
{
stream.CopyTo(outStream);
}
}
如何使用C# API将XLS转GIF
- 创建一个帐户仪表板获得免费的 API 配额和授权详细信息
- 使用客户端 ID、客户端密码、基本 URL 和 API 版本初始化 CellsApi
- 调用 CellsWorkbookPutConvertWorkbook 方法获取结果流
系统要求
- NET Framework 4.5.2 或更新版本
- 网络标准 2.0 或更新版本