title: creating a pdf from a template in itextsharp and outputting as content disposition.
body: <p>I would like to open an existing pdf, add some text and then output as content disposition using itext sharp. I have the following code. Where it falls down it is that i want to output as memory stream but need to filestream to open the original file. </p>
  
  <p>Here's what i have. Obviously defining PdfWriter twice won't work. </p>
  
  <pre><code>   public static void Create(string path)
      {
          var Response = HttpContext.Current.Response;
          Response.Clear();
          Response.ContentType = "application/pdf";
          System.IO.MemoryStream m = new System.IO.MemoryStream();
          Document document = new Document();
          PdfWriter wri = PdfWriter.GetInstance(document, new FileStream(path, FileMode.Create));
          PdfWriter.GetInstance(document, m);
          document.Open();
          document.Add(new Paragraph(DateTime.Now.ToString()));
          document.NewPage();
          document.Add(new Paragraph("Hello World"));
          document.Close();
          Response.OutputStream.Write(m.GetBuffer(), 0, m.GetBuffer().Length);
          Response.OutputStream.Flush();
          Response.OutputStream.Close();
          Response.End();
      } 
  </code></pre>