views:

210

answers:

3

What is the best solution for converting RichTextFormat info to HTML in C#?

I know there are libraries out there that do this, and I was curious to see if you guys had any advice as to which ones are the better ones.

Thanks, Jeff

+1  A: 

I recently used a rtf to html coverter that worked great, called DocFrac.

It can be used with a gui to convert files, but it also is a dll.

I converted over 400 rtf files to html in a few minutes so performance is good too. I used the gui so I don't have the details on the dll. According to the site the DLL works with .NET however.

www.docfrac.net

Tony Peterson
A: 

ScroogeXHTML, a small library for RTF to HTML / XHTML conversion, might be useful. However it only supports a subset of the RTF standard. For reports with tables and other advanced layout, there are other libraries like the Logictran R2Net converter.

mjustin
This is spam. Relevant spam, to be sure, but still spam.
Mystere Man
A: 

I recommend the SautinSoft's RTF-to-HTML DLL .Net, it's C# component to convert:

  • RTF to HTML 3.2, 4.01 + CSS, XHTML
  • Text to HTML
  • RTF to Text

This is a sample code to convert in memory:

Dim r As New SautinSoft.RtfToHtml.Converter()
Dim rtf As String = "{\rtf {\b bold text {\i bold + italic}} and plan text}"
Dim html As String = r.ConvertString(rtf)
Maximus