exportword
v1.0.2
Published
> exportfile is a fast and small JavaScript library. ## feature * the library can export a word which includes normal words,images and chars that building with [echarts](https://www.echartsjs.com/zh/api.html#echarts) ## params (exportElement, exportFileNa
Downloads
3
Readme
exportfile
exportfile is a fast and small JavaScript library.
feature
- the library can export a word which includes normal words,images and chars that building with echarts
params (exportElement, exportFileName, StringStyle,fileParams)
exportElement
- outermost element of all elements that you want to export
exportFileName
- the filename of export file
- the better choice of the file extension is doc
StringStyle
- the style must be string
`#main,#main1{
height: 200px;
width:200px
}
.list{
background: blue;
padding:10px
}
.img{
padding: 50px;
}
.list .page{
background: yellow;
padding: 5px;
height: 20px;
}`
title:
the property of margin will not word in style, but you can replace with text-align
fileParams
- the fileParams contain two params (margin,orientation)
margin: descibe the margin of exported word
top: number (default: 1440, i.e. 2.54 cm)
right: number (default: 1440)
bottom: number (default: 1440)
left: number (default: 1440)
header: number (default: 720)
footer: number (default: 720)
gutter: number (default: 0)
orientation: string (default: portrait)
describe direction of words
use
For example:
import exportFile from 'exportfile'
exportFile({exportElement:'#id', exportFileName:'word.doc', StringStyle,fileParams:{margin:{top:50}}})
there is a samle in the project list:
samle.html
at last (the most important)
- the library is based on the html-docx-js