本文展示了如何从零开始,调用冰蓝云端 Office 文档处理软件服务端 SDK ,实现在线编辑 Office(Word, Excel 和 PowerPoint)及 PDF 文档,完成与您的应用程序对接部分,助您轻松实现高效率、无纸化办公。
下载服务端 Demo 示例
为了帮助开发者方便调用开放接口,我们提供了云端 Office 文档处理软件 Demo 示例,包含 .NET、 JAVA、PHP 和 NodeJS 四种,封装了 Word, Excel, PowerPoint 及 PDF 等文档操作的主要功能。请先下载对应语言版本的 示例 详细了解产品功能。
如果您想直接运行 demo,请先访问 https://cloud.e-iceblue.cn 并注册账号,通过创建应用程序,获得 App ID 和 App key,并将文档 Url 设置为可以访问的域名或服务器公网 IP。若您使用在线编辑的保存功能,则需定义 callBackUrl 进行文档保存。
接口调用配置
在 SDK 调用前需要进行配置,设置如下:
<script language="javascript" type="text/javascript" src="https://api.e-iceblue.cn/web/editors/api/documenteditor.js"></script>
docEditor = new OfficeAPI.DocumentEditor("iframeEditor",
                {
                    width: "100%",
                    height: "100%",
                    editorType: type,
                    isReadOnly: 'False',
                    documentType: "document",
                    document: {
                        key: 
                        title: fileName,
                        url: "oss://demo/sample.docx" 或 "URL不能为空且需确保访问权限"
                        fileType: fileType,
                        info: {
                            author: "Me",
                            created: "2019/11/22"
                        }
                    },
                    editorConfig: {
                        mode: 'True',
                        lang: lang,
                        callbackUrl:
                        user: {
                            id: "192.168.0.100",
                            name: "e-iceblue",
                            token: token,
                            appid: appid,
                            appkey: appkey
                        },
                        customization: {
                            goback: {
                                url: "http://e-iceblue.cn "
                            }
                        }
                    },
                    events: {
                        'onReady': onReady,
                        'onDocumentStateChange': onDocumentStateChange,
                        'onRequestEditRights': onRequestEditRights,
                        'onError': onError,
                        'onOutdatedVersion': onOutdatedVersion,
                        'onSave': callbackfn
                    }
                }关键参数说明
| 配置参数 | 示例值解释 | 设置值 | ||
| width | 宽 | 可为空,默认值100% | ||
| height | 高 | 可为空,默认值100% | ||
| editorType | 编辑类型 'desktop'(电脑端展示) 'mobile'(手机端展示) 'embedded'(嵌入展示) | 不能为空,必须设置为 desktop 或 mobile 或 embedded 中的一种 | ||
| isReadOnly | 仅查看,不能编辑 | 可为空,当为空时,必须设置 editorConfig.mode 值为 true 或 false | ||
| documentType | 文档类型 | 需设置为 document 或 spreadsheet 或 presentation | ||
| document | 文档 | 不能为空 | ||
| Key/title/info/author/created | 关键字/标题/信息/作者/创建日期 | 可为空 | ||
| url | 网络地址 | 不能为空,且需确保访问权限;我们为每个账号提供了2G内存便您使用 | ||
| fileType | 文件类型 | 此参数是文档的真正后缀; 不建议为空,若未设置此项,将从上面URL获取,但无法确保获取正确 | ||
| editorConfig | 编辑配置 | 不能为空 | ||
| mode | 编辑模式 view(查看) edit(编辑) | 可为空,若未设置,则默认为编辑模式 | ||
| lang | 语言 | 可为空,若未设置,则使用浏览器默认语言 | ||
| callbackUrl | 回调 URL | 可为空,若需使用在线编辑的保存功能,则必须定义回调URL | ||
| user | 用户 | 不能为空 | ||
| Id/name | 冰蓝云上的 ID 和名字 | 可为空 | ||
| Appid/appkey | Token 和 AppID/APPkey 二者必有一项不能为空 | 冰蓝云网站注册账号获取该信息 | ||
| customization | 自定义设置 | 可为空 | ||
| events | 事件 'onReady': 'onDocumentStateChange': 'onRequestEditRights': 'onError': 'onOutdatedVersion': 'onSave': |  | ||
若还有任何疑问,请及时联系我们。
- 电话:028-81705109
- 技术支持QQ:2790765778
 



 
					



