# html-docx **Repository Path**: lemonnan/html-docx ## Basic Information - **Project Name**: html-docx - **Description**: html转word - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 2 - **Created**: 2021-03-24 - **Last Updated**: 2025-12-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README html-docx ============ this is a simple library to convert html to docx,it is based on the [html-doxc-js](https://github.com/evidenceprime/html-docx-js) useage ------------- #### Usage and demo ``` yarn add html-docx npm install html-docx --save import HtmlToDocx from 'html-docx' HtmlDocx({ exportElement: '#html-docx', // 需要转换为word的html标签 exportFileName: 'list.docx', // 转换之后word文档的文件名称 StringStyle: '', // css样式以字符串的形式插入进去 margins:{top: 1440,right: 1440,bottom: 1440,left: 1440,header: 720,footer: 720,gutter: 0} // word的边距配置 }) ``` #### use in-inline in html [you can use it refer to the example useage](https://github.com/forever-chen/html-docx/blob/master/test/sample.html) Compatibility ------------ This library should work on any modern browser that supports `Blobs` (either natively or via [Blob.js](https://github.com/eligrey/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 cavans can be generate by common charts library or protogenetic API ------------ ##### `