Converting from RTF to HTML and HTML to RTF

A while back I posted Converting RTF to HTML which showed how to convert RTF text into HTML markup using the WPF RichTextBox control.  Since then I have noticed many posts on forums asking for a free and easy way to go the other way: convert from HTML to RTF. This is actually a very straightforward modification to my original code.

I posted an updated article and the complete sample code for this at Converting between RTF and HTML on the Code Samples Gallery.

  • josey oommen

    how to do same thing in C# VS 2005.

    • The method I showed above wont work in VS 2005 since it uses WPF. I don’t have another method that will work in VS 2005.

      • josey oommen


  • Andy_Luu

    Hi Matthew ! this Article is Nice , but I don’t use it for Metro App Windows 8
    How can I do ?

  • Dave

    Hi, this appears to work but it doesn’t seem to respect the CSS, inline or referenced.

  • John

    Great Job, but It doesn’t work when td havnt width.