翻譯|使用教程|編輯:李顯亮|2020-08-04 10:00:27.407|閱讀 346 次
概述:Spire.Cloud 私有化部署完成后, 可以使用 WEB API 接口,通過代碼在應用程序中操作 Office (Word/Excel/PowerPoint) 及 PDF 文檔。本文將介紹如何在服務器上,調用 Web API 接口。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
你在尋找一款既能在線編輯office文件,又能實現與web應用程序對接的軟件嗎?好巧,冰藍公司最新推出Spire.Cloud,搭載了基于云端的Office在線編輯器和WEB API開發接口,既能安全穩定地實現WEB網頁端在線查看、編輯Office文檔;又能在服務器端通過代碼調用接口簡單高效地實現讀寫Office文檔內容。
Spire.Cloud提供了四種語言的SDK(包括.NET、Java、python、PHP),你可以點擊下載Spire.Cloud Web SDK。
Spire.Cloud 私有化部署完成后, 可以使用 WEB API 接口,通過代碼在應用程序中操作 Office (Word/Excel/PowerPoint) 及 PDF 文檔。
本文將介紹如何在服務器上,調用 Web API 接口,助您輕松高效使用 Spire.Cloud 在線編輯云端 Office。
注意:調用任何接口前,都需要配置相關賬號信息。配置賬號信息時,一定要傳入 appId,appKey。
賬號配置測試代碼如下:
C#
string appId = "Your App ID "; string appKey = "Your App Key "; string baseUrl = "http://api.e-iceblue.cn"; //也可為null Configuration configuration = new Configuration(appId, appKey, baseUrl);
Java
String appId = "Your App ID"; String appKey = "Your App Key"; String baseUrl = "http://api.e-iceblue.cn"; Configuration configuration = new Configuration(appId, appKey, baseUrl);
當將程序部署到自己的服務器后,則不需要輸入 App ID, App Key,此時參數值應設置為“null”,AuthBaseUrl 必須為“null”。現在我們以 //192.168.0.108:8050(192.168.0.108 為私有部署服務器,端口 8050 為 Web API)為例,配置賬號信息代碼如下:
測試代碼如下:
C#
string baseUrl = "http://192.168.0.108:8050"; Configuration configuration = new Configuration(null, null, baseUrl) { AuthBaseUrl = null };
Java
String baseUrl = "http://192.168.0.108:8050"; Configuration configuration = new Configuration(null, null, baseUrl); configuration.setAuthBaseUrl(null); //configuration.getApiClient().setAuthBaseUrl(null);
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn