This code will show you how to use PdfStamper to work with MemoryStreams in C#.NET.

You should download and install itextsharp to your project, then you can try the code pattern following.

using (MemoryStream ms = new MemoryStream()) {
  using (PdfStamper stamper = new PdfStamper(reader, ms, '\0', true)) {
      //process your data 
  }    
  return ms.ToArray();
}

When working with MemoryStream and PdfStamper, write your general pattern as above code.