forked from VolodymyrBaydalka/docxjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
30 lines (26 loc) · 934 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<html>
<head>
<!--polyfills for IE11-->
<script crossorigin src="https://unpkg.com/[email protected]/minified.js"></script>
<!--dependencies-->
<script crossorigin src="https://unpkg.com/jszip/dist/jszip.min.js"></script>
<!--library-->
<script src="dist/docx-preview.js"></script>
</head>
<body>
<input id="files" type="file" id="files" accept=".docx"/> <button id="loadButton">load</button>
<div id="doc">
</div>
<script>
document.getElementById("loadButton").addEventListener("click", loadDocx);
function loadDocx() {
var file = document.getElementById("files").files[0];
var container = document.getElementById("doc");
docx.renderAsync(file, container, null, {
debug: true,
experimental: true
}).then(function(x){ console.log(x); });
}
</script>
</body>
</html>