最近我们分享了我们正在开发下一代 GroupDocs 云 API。我们的产品团队致力于通过可靠、准确的解决方案来改善您的开发体验。因此,我们非常高兴地宣布首次公开发布下一代 GroupDocs.Viewer Cloud REST API 17.11

Groupdocs.Viewer Cloud REST API) 提供了一套有用且强大的功能,使开发人员能够在云中的 Web/移动应用程序或网站中显示 50 多种文档格式。

GroupDocs.Viewer CloudGroupDocs.Viewer

Cloud API 为开发人员提供了一个 API,可以将整个文档、逐页或自定义页面范围的 50 多种文档和图像格式呈现为 HTML 或图像格式。查看器可以对文档进行光栅化并将其转换为 SVG+HTML+CSS,从而提供真实文本的高保真渲染。旋转、重新排序和水印文档页面是此 REST API 的其他重要功能。有关下一代 GroupDocs.Viewer Cloud REST API 提供的功能的完整详细信息,请查看 第一版本的发行说明。以下部分分享有关这些功能的一些详细信息。

获取 HTML 表示形式的附件

您可以获得 HTML 或图像表示形式的电子邮件附件数据。请参阅以下 URI 和 REST 命令(Curl)以了解其目的。

统一资源标识符

[https://api.groupdocs.cloud/v1/viewer/{filename}/html/attachments/{attachmentfilename}][3] 

其余示例(cURL)

curl -v "[https://api.groupdocs.cloud/v1/viewer/Test.msg/html/attachments/Test.pdf"][4] \
-X GET \
-H“内容类型:application/json”\
-H“授权:承载者xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”
```.NET SDK example

//TODO:在 https://dashboard.groupdocs.cloud 获取您的 AppSID 和 AppKey(需要免费注册)。


var 配置 = 新配置
{
应用程序Sid = Sid,
应用密钥 = 密钥
};

var apiInstance = new ViewerApi(配置);

尝试
{
    
var request = new HtmlGetAttachmentRequest
{
文件名 = "with-attachment.msg",
AttachmentName = "受密码保护.docx",
文件夹=空,
存储=空
};

var 响应 = apiInstance.HtmlGetAttachment(request);
Debug.Print("文档处理成功");
}
捕获(异常 e)
{
Debug.Print("从电子邮件获取附件时出现异常:" + e.Message);
}

Watermark a Document for HTML Representation

You can easily watermark and download a document as PDF with GroupDocs.Viewer Cloud API. The API expects PdfFileOptions object data in request body. Please see the following URI, JSON Request data, REST command(Curl) and .NET SDK example for the purpose. 统一资源标识符

[https://api.groupdocs.cloud/v1/viewer/{filename}/html/pdf][5]

Request Data

{"watermark":{"text":"My Company"}}

其余示例(cURL)

卷曲-v“[https://api.groupdocs.cloud/v1/viewer/one-page.docx/html/pdf”][6]\
-X 发布\
-H“内容类型:application/json”\
-H“接受:application/json”\
-d "{"watermark":{"text":"我的公司"}}" \
-H“授权:承载者xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”

.NET SDK example

//TODO:在 https://dashboard.groupdocs.cloud 获取您的 AppSID 和 AppKey(需要免费注册)。
var 配置 = 新配置
{
应用程序Sid = Sid,
应用密钥 = 密钥
};

var apiInstance = new ViewerApi(配置);

尝试
{
var pdfFileOptions = new GroupDocs.Viewer.Cloud.Sdk.Model.PdfFileOptions
{
水印 = new GroupDocs.Viewer.Cloud.Sdk.Model.Watermark { Text = "测试" }
};
var request = new ImageCreatePdfFileRequest
{
文件名 = "一页.docx",
Pdf文件选项 = pdf文件选项,
字体文件夹 = null,
文件夹=空,
存储=空,
};

var 响应 = apiInstance.ImageCreatePdfFile(请求);

Debug.Print("文档已处理");
调试.打印(响应.文件名);
调试.打印(响应.文件夹);
调试.打印(响应.PdfFileName);
}
捕获(异常 e)
{
Debug.Print("处理文档时出现异常:" + e.Message);
}

GroupDocs.Viewer Cloud Resources

Following are the links to some useful resources you may need to accomplish your tasks.

Start a Free Trial Today

Start a free trial today – all you need is to sign up with the GroupDocs Cloud service. Once you have signed up, you are ready to try the powerful file processing features offered by GroupDocs Cloud.