且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在没有安装 MS Word 的情况下将 html 导出到 Word 的***方法?

更新时间:2022-11-04 09:47:06

如果你说的只有简单的HTML页面,可以用Word打开.

If you have only simple HTML pages as you said, it can be opened with Word.

否则,有一些库可以做到这一点,但我没有使用它们的经验.

Otherwise, there are some libraries which can do this, but I don't have experience with them.

我的最后一个想法是,如果您使用的是 ASP.NET,请尝试将 application/msword 添加到标题中,然后您可以将其另存为 Word 文档(它不会是真正的 Worddoc,只有重命名为 doc 的 HTML 才能打开).

My last idea is that if you are using ASP.NET, try to add application/msword to the header and you can save it as a Word document (it won't be a real Word doc, only an HTML renamed to doc to be able to open).