zplCore.comzplCore.com

RtfConverter

public static class RtfConverter
RTF to the HTML subset of TextMarkup.Html, e.g. text written with a WinForms/WPF RichTextBox or WordPad: item.Text = RtfConverter.ToHtml(rtf); item.Markup = TextMarkup.Html;
  • Character formatting: \b \i \ul \ulnone \strike \fs (size), \f (font table → font-family), \cf (colour table → color), \highlight/\cb (→ mark), \plain; paragraph: \par \line \pard \ql \qc \qr \qj, \tab (a space).
  • Styles of the style sheet (\sN, \csN) apply their character formatting.
  • Text: \'hh in the document code page (\ansicpg, default 1252), \uN with its fallback skipped (\ucN), \~ \- \_, escaped braces and backslashes.
  • Ignored: pictures, fields' instructions, other destinations (\*), and right-to-left text direction (\rtlpar, \rtlch) – the rich text layout runs left to right.

Methods

Method SignatureReturnsDescription
static # ToHtml(string rtf)stringConverts RTF to HTML for TextMarkup.Html (see the class remarks for what is kept).