The basic HTML-to-DOCX conversion process is really quite simple - all you have to do is to install NOV from the NuGet package
and then execute the following code:
NRichTextView richTextView = new NRichTextView();
richTextView.LoadFromLocalFile(@"C:\Documents\Article.html");
richTextView.SaveToLocalFile(@"C:\Documents\Article.docx");
You can also convert the documents in memory if the code is part of a processing service. For example, to get a BLOB in DOCX format from the loaded
HTML, you need to write:
MemoryStream memoryStream = new MemoryStream();
view.SaveToStream(memoryStream, NTextFormat.Docx);
byte[] byteArrayContainingDocx = memoryStream.ToArray();