Class Rtf
Convert a Rich Text Format (RTF) document to HTML
Inherited Members
Namespace: SharpRtfConvert
Assembly: SharpRtfConvert.dll
Syntax
public static class Rtf
Methods
| Edit this page View SourceToHtml(RtfSource, RtfHtmlSettings?)
Convert a Rich Text Format (RTF) document to an HTML string
Declaration
public static string ToHtml(RtfSource source, RtfHtmlSettings? settings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| RtfSource | source | The source RTF document (either a string, TextReader, or Stream) |
| RtfHtmlSettings | settings | The settings used in the HTML rendering |
Returns
| Type | Description |
|---|---|
| string | An HTML string that can be used to render the RTF |
ToHtml(RtfSource, TextWriter, RtfHtmlSettings?)
Convert a Rich Text Format (RTF) document to HTML
Declaration
public static void ToHtml(RtfSource source, TextWriter writer, RtfHtmlSettings? settings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| RtfSource | source | The source RTF document (either a string, TextReader, or Stream) |
| TextWriter | writer | TextWriter that the HTML will be written to |
| RtfHtmlSettings | settings | The settings used in the HTML rendering |
ToHtml(RtfSource, XmlWriter, RtfHtmlSettings?)
Convert a Rich Text Format (RTF) document to HTML
Declaration
public static void ToHtml(RtfSource source, XmlWriter writer, RtfHtmlSettings? settings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| RtfSource | source | The source RTF document (either a string, TextReader, or Stream) |
| XmlWriter | writer | XmlWriter that the HTML will be written to |
| RtfHtmlSettings | settings | The settings used in the HTML rendering |
Examples
This overload can be used for creating a document that can be further manipulated
var doc = new XDocument();
using (var writer = doc.CreateWriter())
{
Rtf.ToHtml(rtf, writer);
}