// =========================================================================== public void Write(Stream stream) { using (ZipFile zip = new ZipFile()) { Subscribe s = new Subscribe(); byte[] pdf = s.CreatePdf(); string PdfName = Utility.ResultFileName(s.ToString() + ".pdf"); zip.AddEntry(PdfName, pdf); FdfWriter fdf = new FdfWriter(); /* * we're hard-coding the FDF data, not receiving it from an * HTML page like the book example */ fdf.SetFieldAsString("personal.name", "HARD-CODED name"); fdf.SetFieldAsString("personal.loginname", "HARD-CODED loginname"); fdf.SetFieldAsString("personal.password", "HARD-CODED password"); fdf.SetFieldAsString("personal.reason", "HARD-CODED reason"); fdf.File = PdfName; using (MemoryStream ms = new MemoryStream()) { fdf.WriteTo(ms); zip.AddEntry("subscribe.fdf", ms.ToArray()); } zip.Save(stream); } }
// --------------------------------------------------------------------------- public void Write(Stream stream) { using (ZipFile zip = new ZipFile()) { Subscribe s = new Subscribe(); byte[] pdf = s.CreatePdf(); zip.AddEntry(Utility.ResultFileName(s.ToString() + ".pdf"), pdf); InspectForm i = new InspectForm(); zip.AddEntry(RESULTTXT, i.InspectPdf(pdf)); zip.Save(stream); } }
// --------------------------------------------------------------------------- public void Write(Stream stream) { using (ZipFile zip = new ZipFile()) { zip.AddFile(JS1, ""); zip.AddFile(JS2, ""); zip.AddEntry("javascript.html", string.Format(HTML, RESULT)); Subscribe s = new Subscribe(); byte[] pdf = s.CreatePdf(); JSForm j = new JSForm(); zip.AddEntry(RESULT, j.ManipulatePdf(pdf)); zip.Save(stream); } }
// --------------------------------------------------------------------------- public void Write(Stream stream) { SubmitForm x = new SubmitForm(); x.WebContext = HttpContext.Current; if (x.WebContext != null) { Subscribe sub = new Subscribe(); byte[] pdf = sub.CreatePdf(); x.WebContext.Response.ContentType = "application/pdf"; x.ManipulatePdf(pdf, stream); } else { x.SendCommandLine(stream); } }
// --------------------------------------------------------------------------- public void Write(Stream stream) { FDFServlet x = new FDFServlet(); 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); } }