PdfWriter writer =PdfWriter.GetInstance(doc,ms);
            writer.CloseStream=false;


for detail :
http://hardrock.cnblogs.com/archive/2006/02/23/336397.html


http://hardrock.cnblogs.com