HTML转换为Doc(Word)或RTF格式
将html页面(带有CSS,表格,图像等)转换为word或rtf格式的最佳方法是什么?我已经知道有关添加
What would the best possible way to convert a html page (with css, tables, images etc.) to be converted to word or rtf format. I already know about adding the
content-type = application/word
页眉,这不是一种选择,因为我们需要在文档中嵌入图像,以便在没有活动的Internet连接的情况下也可以查看它.
header and that's not an option because we need the images embedded in the document so that it can be viewed without an active internet connection.
我需要一个免费的(最好是)或商业的.NET库或一个命令行实用程序,因为我需要在共享服务器上的托管ASP.NET应用程序上执行此操作:|.
I need either a free (preferably) or commercial .NET library or a command line utility as I need to do this on a hosted ASP.NET application on a shared server :|.
如果使用的是Word 2003或2007,则可以使用xslt将xhtml文档转换为Word Xml文档.如果您通过Google搜索这也是可能的.
If you are using Word 2003 or 2007 you can convert xhtml documents to Word Xml documents using xslt. If you google for html to docx xsl you will find many examples of the opposite (converting docx to html) so you might one of those examples as a basis for a conversion. The only challenge would be downloading and embedding the images in the document, but that is also possible.