title: Error while parsing Tinymce Editor string
body: <p>I am parsing the HTML with the help of following code. The html comes from tinymce editor. I have just shortened my code. There can be any number of images in the <code>EmailBody string</code> as it is selected by the user in tinymce editor.</p>
  
  <p>All works good except when there is <code>&lt;img src=""&gt;</code> tag in the Email Body.</p>
  
  <p>I get the error on this line <code>htmlWorker.Parse(sr);</code></p>
  
  <pre><code>string EmailBody = @"&lt;p&gt;&lt;img src=""http://weknowyourdreams.com/images/smile/smile-07.jpg""&gt;&lt;/p&gt;";
  using (var ms = new MemoryStream())
  {
      //Create an iTextSharp Document which is an abstraction of a PDF but **NOT** a PDF
      using (var doc = new Document())
      {
          //Create a writer that's bound to our PDF abstraction and our stream
          using (var writer = PdfWriter.GetInstance(doc, ms))
          {
              //Open the document for writing
              doc.Open();
              using (var htmlWorker = new iTextSharp.text.html.simpleparser.HTMLWorker(doc))
              {
                  //HTMLWorker doesn't read a string directly but instead needs a TextReader (which StringReader subclasses)
                  using (var sr = new StringReader(EmailBody))
                  {
                      //Parse the HTML
                      htmlWorker.Parse(sr);
                  }
              }
              doc.Close();
          }
      }
      bytes = ms.ToArray();
  }
  </code></pre>
  
  <p>Gives me this error:</p>
  
  <blockquote>
    <p>Cannot access a closed Stream</p>
  </blockquote>
  
  <p>How to fix this error?</p>