Example #1
0
 public HtmlRootProcessor(ProcessorStack stack, TextWriter writer, Options options)
 {
     if (options == null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     colors       = new ColorProcessor();
     this.stack   = stack;
     this.writer  = writer;
     this.options = options;
 }
Example #2
0
 public static string FromRTF(string rtf, Options options = null)
 {
     using (var stringWriter = new StringWriter())
     {
         using (var stringReader = new StringReader(rtf))
         {
             var stack             = new ProcessorStack();
             var htmlRootProcessor = new HtmlRootProcessor(stack, stringWriter, options ?? new Options());
             stack.Push(htmlRootProcessor);
             new Parser(new Scanner(stringReader), stack).Parse();
             return(stringWriter.ToString());
         }
     }
 }