javascript - How to use Docx.js? -
i have use docx.js generate docx file, generaeted docx doenot open. generated docx file output is
i have included following js file html page
<script type="text/javascript" src="js/docx/jszip.js"></script> <!-- include main js lib --> <script type="text/javascript" src="js/docx/docx.js"></script>
and javascript function is
function test() { //alert("test fn call"); var doc = new docxjs(); doc.text('docx.js free open source library generating microsoft word documents using pure client-side javascript.'); //doc.text('it developed james hall @ snapshot media.'); var output = doc.output('datauri'); }
when click button function calling, , want add datatable content of word document how add content using docx.js?
probably trying use docx.js without server, not work because can't load necessary files. if executing code on server edit path of '/blank/' somewhere in docx.js file
$.ajax({ url: '/blank/' + files[file], complete: function(r) { //file_data[this.url.replace(/blank_/, '')] = r.responsetext; zip.add(this.url.replace('/blank/', ''), r.responsetext); file_count_current ++; if (file_count == file_count_current) { dooutput(); } } });
Comments
Post a Comment