transform-doc-to-html
v1.1.4
Published
transform docx file content to html or text
Downloads
23
Maintainers
Readme
transform .docx file to html
Installation
npm install transform-doc-to-html
Usage
as react lib
import Doc2Html from 'transform-doc-to-html'
function App(){
return (
<Doc2Html
onResult={html => doSomething(html)}
imageUploadOptions={{}}
>
<div>上传doc</div>
</Doc2Html>
)
}
or
as function
import { getHtmlFromDocFile, extractRawText } from 'transform-doc-to-html'
const html = await getHtmlFromDocFile(file, imageUploadOptions)
const text = await extractRawText(file)
options
- onResult: return html,required
- imageUploadOptions
- api: upload interface
- code: 'file' | 'image', interface param code
- processResult: uploadResult => imageUrl