Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
This component can convert HTML to Word:http://www.sautinsoft.com/products/html-to-rtf/index.php
This is a sample code:
SautinSoft.HtmlToRtf h = new SautinSoft.HtmlToRtf();
//here we specify page numbers
h.PageNumbers = SautinSoft.HtmlToRtf.ePageNumbers.PageNumFirst;
h.HtmlPath = Server.MapPath("");
string rtf = h.ConvertFileToString(Server.MapPath(""), @Default.aspx);
//show Word/rtf
if (rtf != "")
{
Response.Buffer = true;
Response.Clear();
Response.ContentType = "aplication/msword";
Response.AddHeader("Content-Disposition:", "attachment; filename=Test.doc");
Response.Write(rtf);
Response.Flush();
Response.End();
}
Or another sample to convert in memory:
SautinSoft.HtmlToRtf h = new SautinSoft.HtmlToRtf();
string word = h.ConvertString(htmlString);
Download complete functional trial: http://www.sautinsoft.com/components/htmltortf_pro_net.zip
Best wishes,
Max