js-word-image

1.2.3 • Public • Published

js-word-image V1.2.3

Support the front-end export of word documents to local, support the customization of word content, and support pictures (URL format)

Update V1.2.3

更新将npm包打包后ES6转ES5

Installation

npm -i --save sw-exportword

In JavaScript

Support word

import { ExportWord } from 'sw-exportword';

const htmlStr = `<div>
                    <span>Hello Word</span>
                    <img width=400 height=300 src='httpurl'  alt='Loading failed'>
                </div>`;
// 导出 支持传入String类型
ExportWord(htmlStr, 'wordname.doc');

Supports custom styles for word text

import { ExportWord } from 'sw-exportword';

const htmlStr = `<div>
                    <span class='title-span'>Hello Word</span>
                </div>`;
const htmlStyle = ".title-span{ font-size:16px; color:red }";

// Export Supports incoming Object types containing custom styles
ExportWord({htmlStr, htmlStyle}, 'wordname.doc');

Supports exporting images to word documents (only URL format is supported temporarily)

import { ExportWord } from 'sw-exportword';

const htmlStr = `<img width="300" height="300" src="httpurl" alt="Loading failed" />`;

// Export Support for pictures (URL format)
ExportWord(htmlStr, 'wordname.doc');

Readme

Keywords

Package Sidebar

Install

npm i js-word-image

Weekly Downloads

0

Version

1.2.3

License

ISC

Unpacked Size

7.65 kB

Total Files

5

Last publish

Collaborators

  • lhxjoker