Пример #1
0
    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);
    }
Пример #2
0
 public HTMLRootProcessor(ProcessorStack stack, TextWriter writer)
 {
     this.stack  = stack;
     this.writer = writer;
 }