public static string FromRTF(string rtf) { string str; using (StringWriter writer = new StringWriter()) { using (StringReader reader = new StringReader(rtf)) { ProcessorStack stack = new ProcessorStack(); HTMLRootProcessor processor = new HTMLRootProcessor(stack, writer); stack.Push(processor); Scanner scanner = new Scanner(reader); new Parser(scanner, stack).Parse(); str = writer.ToString(); } } return(str); }
public HTMLRootProcessor(ProcessorStack stack, TextWriter writer) { this.stack = stack; this.writer = writer; }