C# FreeSpire.Doc
免費的word文檔類庫
環境准備
Nuget安裝
- FreeSpire.Doc
引用
using Spire.Doc;
using Spire.Doc.Documents;
using System.IO;
Html轉換為word文檔
static void GetHtmlDocument() {
Document doc = new Document();
TextReader reader = new StringReader("<html><head></head><body><div>HelloWorld</div></body></html>");
doc.LoadHTML(reader, XHTMLValidationType.None);
doc.SaveToFile("test1.doc");
}