Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

插件很好用,可以简单介绍下原理吗 #1

Open
sskf opened this issue Jan 12, 2024 · 1 comment
Open

插件很好用,可以简单介绍下原理吗 #1

sskf opened this issue Jan 12, 2024 · 1 comment

Comments

@sskf
Copy link

sskf commented Jan 12, 2024

看了下onlyoffice的官方文档,没找到直接在本地实现编辑的方案,都是需要后端部署server,然后前端引用对应的api.js,比较重。
您这种插件方案很轻量,想了解下具体的实现思路,或者有没有参考文档。

@sweetwisdom
Copy link

你把扩展解压,可以发现有一个officedll文件,这个是实现文件的解析和保存

 case 'x2t':
        NpPlugin.x2t(data.path, data.format, data.password).then(response)
        break
      case 'x2tBuf':
        NpPlugin.x2tBuf(data.isPdfPrint, data.base64Buf, data.path, data.format).then(response)
        break
      case 'fileSelect':
        NpPlugin.fileSelect(data.type).then(response)
        break
      case 'writeFile':
        NpPlugin.writeFile(data.base64Buf, data.relativePath).then(response)
        break
      case 'readFile':
        NpPlugin.readFile(data.path).then(response)
        break
      case 'setBinPath':
        NpPlugin.setBinPath(data.path).then(response)
        break

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants