title: Loading an iTextSharp Document into MemoryStream
body: <p>I'm developing an ASP.NET application where I have to send an PDF based on a Table created dinamically on the page as attachment on a email. So I have a function that creates the PDF as iTextSharp Document and returns it. If i try just to save this document, it works fine but I'm having a bad time trying to make it as Stream. I tried several things already, but I always get stuck at some point.</p>
  
  <p>I tried to serialize it, but appears that Document is not serializable. Then I tried to work with PdfCopy, but I couldn't find out how to use this to my problem in specific.</p>
  
  <p>The code right now is like this:</p>
  
  <pre><code>//Table,string,string,Stream
  //This document returns fine
  Document document = Utils.GeneratePDF(table, lastBook, lastDate, Response.OutputStream);
  
  using (MemoryStream ms = new MemoryStream())
  {
      PdfCopy copy = new PdfCopy(document, ms);
      //Need something here to copy from one to another! OR to make document as Stream      
      ms.Position = 0;
      //Email, Subject, Stream
      Utils.SendMail(email, lastBook + " - " + lastDate, ms);
  }
  </code></pre>