HTML to word

Time:2021-4-13

Based on their own HTML docx JS package function more complete transfer word library

New function points

  • The header and footers of word can be configured by labels
  • The directory can be generated automatically
  • You can add a tab to word (the first page is different)
  • You can end the current page at any time and open a new page

usage

Usage and demo

yarn add html-docx   npm install html-docx --save

import HtmlToDocx from 'html-docx'
HtmlDocx({
    Exportelement: '#html docx' // HTML tag to be converted to word
    exportFileName: ' list.docx '// the file name of the converted word document
    Stringstyle: ', // the CSS style is inserted as a string
    Margins: {top: 1440, right: 1440, bottom: 1440, left: 1440, header: 720, footer: 720, gutter: 0} // the margin configuration of word
})

use in-inline in html

you can use it refer to the example useage

Recommended Today

Java Engineer Interview Questions

The content covers: Java, mybatis, zookeeper, Dubbo, elasticsearch, memcached, redis, mysql, spring, spring boot, springcloud, rabbitmq, Kafka, Linux, etcMybatis interview questions1. What is mybatis?1. Mybatis is a semi ORM (object relational mapping) framework. It encapsulates JDBC internally. During development, you only need to pay attention to the SQL statement itself, and you don’t need to […]