最近我們分享了我們正在開發下一代 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.