C# HTML转换为WORD

使用aspose.words仅需要4句代码,即可搞定。

1 Document doc = new Document();
2 DocumentBuilder builder = new DocumentBuilder(doc);
3 builder.InsertHtml(@"<html><body><img src='C:/Users/zhouy09/Desktop/Test/底部图片--公司愿景.jpg'></body></html>");
4 doc.Save("E:/DownLoadWord/DocumentBuilder.InsertTableFromHtml Out.doc");

 

备注:会将html中图片链接转为word文档中 ,如果你还在为将HTML转换为WORD时图片链接的处理而苦恼,没错,你找到了,用ASPOSE>WORDS就不用再去管什么图片链接了,直接转为WORD内置图片

posted @ 2016-03-22 16:06  看看我的眼神  阅读(10142)  评论(1编辑  收藏  举报