1.0.2 • Published 5 years ago

exportword v1.0.2

Weekly downloads
2
License
ISC
Repository
-
Last release
5 years ago

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

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)