我需要将doc / docx转换为html。 我有存储在亚马逊s3中的文件。 我需要在浏览器中查看和编辑它。 现在,我正在使用Apache POI将doc / docx转换为html。 我正在HTML编辑器(Jquery插件)上显示响应。 它工作但对齐/格式更改。 也是未提取的图像。 任何修复图像提取和格式化问题的解决方案,请参考或引用任何Jquery / JS插件进行转换。
I need to convert doc/docx to html. I have files stored in Amazon s3. I need to view & edit it in browser. Right now, I am using Apache POI to convert doc/docx to html. And I am displaying the response on HTML editor(Jquery Plugin). It works but alignment/format changes. Also images not extracted. Any solution to fix image extraction & formatting issues, please refer or refer any Jquery/JS plugin for conversion.
最满意答案
快速进行谷歌搜索,我找到了这些库:(我没有使用过,也没有认可过这些库)
docx2html 长毛象docx2html基本功能:
var docx2html=require('docx2html') docx2html(fileInput.files[0],{container:document.getElementById('a')}).then(function(html){ html.toString() })庞大的基本功能:
var mammoth = require("mammoth"); mammoth.convertToHtml({path: "path/to/document.docx"}) .then(function(result){ var html = result.value; // The generated HTML var messages = result.messages; // Any messages, such as warnings during conversion }) .done();我希望这至少是有用的
Doing a quick Google Search, I found these libraries: (I have not used, nor endorsed any of these)
docx2html mammothdocx2html basic functionality:
var docx2html=require('docx2html') docx2html(fileInput.files[0],{container:document.getElementById('a')}).then(function(html){ html.toString() })mammoth basic functionality:
var mammoth = require("mammoth"); mammoth.convertToHtml({path: "path/to/document.docx"}) .then(function(result){ var html = result.value; // The generated HTML var messages = result.messages; // Any messages, such as warnings during conversion }) .done();I hope this was, at least, useful
更多推荐
发布评论