是否可以使用jquery / javascript将doc / docx转换为html?(Is it possible to convert doc/docx to html using jquery

系统教程 行业动态 更新时间:2024-06-14 16:57:40
是否可以使用jquery / javascript将doc / docx转换为html?(Is it possible to convert doc/docx to html using jquery/javascript? [closed])

我需要将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 mammoth

docx2html 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

更多推荐

本文发布于:2023-04-13 12:42:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/8efa0051c23e0b74454f65e8037edadd.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:可以使用   转换为   javascript   docx   jquery

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!