html-docx ============
npm install html-docxhtml-docx
============
this is a simple library to convert html to docx,it is based on the html-doxc-js
useage
-------------
#### Usage and demo
``
`
yarn add html-docx npm i html-docx --save cnpm i html-docx --save
import HtmlToDocx from 'html-docx'
HtmlToDocx({
exportElement: '#html-content', // 需要转换为word的html标签
exportFileName: 'list.docx', // 转换之后word文档的文件名称
StringStyle: '', // css样式以字符串的形式插入进去
margins:{top: 1440,right: 1440,bottom: 1440,left: 1440,header: 720,footer: 720} // word的边距配置
})
Blobs
#### use in-inline in html
you can use it refer to the example useage
Compatibility
------------
This library should work on any modern browser that supports (either natively or via
Blob.js). It was tested on Google Chrome 36, Safari 7 and
Internet Explorer 10.
Images Support
------------
* images/cavans is supported in the library
the src of images can be URI or inlined base64(图片不要太大,因为图片会以base64的格式插入进去)
* cavans can be generate by common charts library or protogenetic(cavans图表也支持)
API
------------
#####
* 这个元素内部设置元素docx文档的配置信息(具体设置可以到sample例子中看)
#####
* 这个元素内部文字设置为文档的页眉
* textAlign设置文字居中格式
#####
* 这个标签内的元素设置为文档的封面
* 这里不会有页眉、页脚、
* 这里不能有h标签
####
* 如果需要目录则添加这个元素,不需要目录就不需要添加这个元素
####
* 这个元素用来开启新的页面,在需要开启新页面的地方直接添加这个元素即可
#### `