/docxjs

Docx rendering library

Primary LanguageTypeScriptApache License 2.0Apache-2.0

npm version

docxjs

Docx rendering library

Demo - http://zVolodymyr.github.io/docxjs

Usage

<!--optional polyfill for promise-->
<script src="https://unpkg.com/promise-polyfill/dist/polyfill.min.js"></script>
<!--lib uses jszip-->
<script src="https://unpkg.com/jszip/dist/jszip.min.js"></script>
<script src="docx-preview.min.js"></script>
<script>
    var docData = <document Blob>;

    docx.renderAsync(docData, document.getElementById("container"))
        .then(x => console.log("docx: finished"));
</script>
<body>
    ...
    <div id="container"></div>
    ...
</body>

Status and stability

So far I can't come up with final approach of parsing documents and final structure of API. Main development is moved to next branch. Only renderAsync function is stable and definition shouldn't be changed in future. Inner implementation of parsing and rendering may be changed at any point of time.