将 Word 转换为 HTML,然后在网页上呈现 HTML [英] Convert Word to HTML then render HTML on webpage

查看:17
本文介绍了将 Word 转换为 HTML,然后在网页上呈现 HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的管道中有一个艰巨的项目,但我不知道从哪里开始.我的老板希望能够以 HTML 格式显示 Word 文档,并且它看起来与 Word 文档相同.

I have a tough project in my pipeline and I'm not sure where to begin. My boss wants the ability to display a Word Document in HTML and it look the same as the word document.

在一次又一次地尝试让我在弹出窗口或灯箱中显示 word 文档后,他坚持要剥离单词的内容,将其转换为 HTML,将其保存在数据库中,然后将其显示为 HTML在网页上.

After trying time after time to just let me show the word document in a pop up or a light box he is stuck on stripping out the contents of the word converting it to HTML saving that in a database and then displaying it as HTML on a webpage.

你们能不能给我一些好的弹药,看看显示 word 文档是否更好(不那么麻烦,更少的存储空间更安全等).

Can you guys either give me some good ammo as to if showing the word document is better (less cumbersome, less storage space more secure etc).

或者,如果我可以很容易地将 Word 文档转换为 HTML 格式.

Or if it's pretty easy to convert a word document to HTML ways for me to do that.

我目前拥有的技术是实体框架、LINQ、MVC、C#、Razor.

The technologies I current have are Entity Framework, LINQ, MVC, C#, Razor.

我们目前使用 HTmlAgilityPack,但这会去除所有格式,并且无法很好地显示文档.

We currently use HTmlAgilityPack, but this strips out all of the formatting and doesn't allow the document to show very well.

推荐答案

我们使用 http://www.aspose.com/(我认为我们使用的是 Aspose words)来执行类似的任务,并且效果很好.(有成本)

We use http://www.aspose.com/ (I think the one we use is Aspose words) to perform s similar task, and it works quite well. (there is a cost involved)

我建议转换为 HTML 会给出最糟糕的文档再现.我们使用的一种解决方案是生成文档的 Jpeg 图像并显示该图像.

I would suggest that converting to HTML gives the worst rendition of the document. One solution we use, is to generate a Jpeg image of the document and display that.

如果您需要能够执行查找和复制/粘贴文本等操作 - 我建议将文档转换为 .pdf,并在客户端计算机安装的任何标准 pdf 查看器中内嵌显示.

If you need to be able to perform operations like find and copy/pasting text - I would recommend converting the document to a .pdf, and displaying it inline, in whichever standard pdf viewer the client machine has installed.

这篇关于将 Word 转换为 HTML,然后在网页上呈现 HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆