https://github.com/dhjz/export-doc
纯前端js将html导出word文档doc文档(含样式、图片、canvas等元素), 没有其他依赖,支持排除指定样式
https://github.com/dhjz/export-doc
export-doc export-word js-export js-export-doc js-export-word
Last synced: about 1 year ago
JSON representation
纯前端js将html导出word文档doc文档(含样式、图片、canvas等元素), 没有其他依赖,支持排除指定样式
- Host: GitHub
- URL: https://github.com/dhjz/export-doc
- Owner: dhjz
- Created: 2024-08-08T08:03:02.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-08-09T01:37:14.000Z (almost 2 years ago)
- Last Synced: 2025-03-31T13:36:57.349Z (about 1 year ago)
- Topics: export-doc, export-word, js-export, js-export-doc, js-export-word
- Language: JavaScript
- Homepage:
- Size: 583 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
### 介绍
纯前端js将html导出word文档doc文档(含样式、图片、canvas等元素), 没有其他依赖,支持排除指定样式
### 示例
[http://199311.xyz/export-doc/example/index.html](http://199311.xyz/export-doc/example/index.html)
### 构建
```shell
npm install
npm run build
```
### 使用
- 详见`example/index.html`
``` html
ExportDoc.toWord('#test-word', {
title: '关于导出王麻子这件事情',
time: '2024年8月15日 上午10点',
fileName: '剑来.doc', // 导出文件名
maxWidth: 550, // 正文图片最大宽度,
blob: false, // 返回结果为blob
exclude: ['.not-export', '.not-export1'] // // 排除元素选择器
})
```