Socket
Book a DemoInstallSign in
Socket

office-viewer

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

office-viewer

office 文档在线预览

latest
npmnpm
Version
0.3.14
Version published
Weekly downloads
799
-29.1%
Maintainers
2
Weekly downloads
 
Created
Source

说明

Word 和 Excel 渲染器,目前接口还未完全稳定,新版可能会修改,请参考 examples

Word 渲染

原理

Word 渲染器,原理是将 docx 里的 xml 格式转成 html

相对于 Canvas 渲染,这个实现方案比较简单,最终页面也可以很方便复制,但无法保证和原始 docx 文件展现一致,因为有部分功能难以在 HTML 中实现,比如图文环绕效果。

已知不支持的功能

  • 艺术字
  • 对象
  • wmf,需要使用 https://github.com/SheetJS/js-wmf

参考资料

日常开发可以使用 OOXML viewer 插件查看

开发过程啊参考了

Excel 渲染

原理

使用 Canvas 渲染

Keywords

office

FAQs

Package last updated on 23 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts