// --------------------------------------------------------------------------- public void Write(Stream stream) { XFDFServlet x = new XFDFServlet(); x.WebContext = HttpContext.Current; if (x.WebContext != null) { Subscribe s = new Subscribe(); byte[] pdf = s.CreatePdf(); x.WebContext.Response.ContentType = "application/pdf"; if (Utility.IsHttpPost()) { x.DoPost(pdf, stream); } else { x.DoGet(pdf, stream); } } else { x.SendCommandLine(stream); } }