当前位置:   article > 正文

onlyoffice api使用

onlyoffice api

参考:

ONLYOFFICE API 文档 - 自动化API

使用 ONLYOFFICE 宏快速删除多余空格_ONLYOFFICE的技术博客_51CTO博客

ONLYOFFICE Api Documentation - InsertContent 

 插入文本

  1. var connector = docEditor.createConnector()
  2. connector.callCommand(function() {
  3. var oDocument = Api.GetDocument();
  4. var oParagraph = Api.CreateParagraph();
  5. oParagraph.AddText("放大:{范德}萨");
  6. oDocument.InsertContent([oParagraph],{ "KeepTextOnly": true });
  7. }, function() {
  8. console.log("callback command");
  9. });

 callCommand函数设计的隔离性非常好,Api在函数里面是可以访问到的,在外面访问不到

InsertContent 不输入第2个参数的时候,插入后会自动换行

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/很楠不爱3/article/detail/476213
推荐阅读
相关标签
  

闽ICP备14008679号