接口调用配置
在 SDK 调用前需要进行配置,设置如下:
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                    }                }
Spire.Cloud提供了四种语言的SDK(包括.NET、Java、python、PHP),你可以Spire.Cloud Web SDK。
关键参数说明
| 配置参数 | 示例值解释 | 设置值 | ||
| width | 宽 | 可为空,默认值100% | ||
| height | 高 | 可为空,默认值100% | ||
| editorType | 不能为空,必须设置为 desktop 或 mobile 或 embedded 中的一种 | |||
| isReadOnly | 可为空,当为空时,必须设置 editorConfig.mode 值为 true 或 false | |||
| documentType | 文档类型 | 需设置为 document 或 spreadsheet 或 presentation | ||
| document | 文档 | 不能为空 | ||
| Key/title/info/author/created | 可为空 | |||
| url | 络地址 | 不能为空,且需确保访问权限;我们为每个账 提供了2G内存便您使用 | ||
| fileType | 文件类型 | 此参数是文档的真正后缀; 不建议为空,若未设置此项,将从上面URL获取,但无法确保获取正确  | 
||
| editorConfig | 不能为空 | |||
| mode | ||||
| lang | 语言 | 可为空,若未设置,则使用浏览器默认语言 | ||
| callbackUrl | 回调 URL | |||
| user | 用户 | 不能为空 | ||
| Id/name | 冰蓝云上的 ID 和名字 | 可为空 | ||
| Appid/appkey | Token 和 AppID/APPkey 二者必有一项不能为空  | 
冰蓝云 站注册账 获取该信息 | ||
| customization | 自定义设置 | 可为空 | ||
| events | 事件 ‘onReady’: ‘onDocumentStateChange’: ‘onRequestEditRights’: ‘onError’: ‘onOutdatedVersion’: ‘onSave’:  | 
|||
是E-iceblue官方友好合作伙伴,如果您对Spire.Cloud感兴趣,可以联系在线客服了解具体授权价格和使用机制。
标签:
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!