Theres another post at HTML to RTF Converter for .NET, but are there any open source converters or tutorials? I don't want to use Sautinsoft. I think there is a solution at ExpertsExchange, but I have to pay for that. Most of the search results on google point to an RTF to html converter, but not a html to RTF converter.
Create a WebBrowser. Load it with the html content. Select all and copy from it. Paste into a richtextbox. Then you have the RTF
string html = "...."; // html content
RichTextBox rtbTemp = new RichTextBox();
WebBrowser wb = new WebBrowser();
wb.Navigate("about:blank");
wb.Document.Write(html);
wb.Document.ExecCommand("SelectAll", false, null);
wb.Document.ExecCommand("Copy", false, null);
rtbTemp.SelectAll();
rtbTemp.Paste();
Now rtbTemp.RTF has the RTF converted from the HTML.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With