Пример #1
1
// --------------------------------------------------------------------------- 
    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);             
      }
    }    
Пример #2
0
// ---------------------------------------------------------------------------
    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);
      }
    }
Пример #3
0
// ---------------------------------------------------------------------------
    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);
      }
    }
Пример #4
0
// ---------------------------------------------------------------------------
    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);
      }
    }
Пример #5
0
// ---------------------------------------------------------------------------
    public void Write(Stream stream) {
      using (ZipFile zip = new ZipFile()) {
        Subscribe subscribe = new Subscribe(); 
        byte[] pdf = subscribe.CreatePdf();
        zip.AddEntry(FORM, pdf);
        Dictionary<string, TextField> fieldCache = 
            new Dictionary<string, TextField>();        
        zip.AddEntry(string.Format(RESULT, 1), 
          subscribe.ManipulatePdf(pdf, fieldCache, "Bruno Lowagie", "blowagie"
        ));
        zip.AddEntry(string.Format(RESULT, 2), 
          subscribe.ManipulatePdf(pdf, fieldCache, "Paulo Soares", "psoares"
        ));
        zip.AddEntry(string.Format(RESULT, 3), 
          subscribe.ManipulatePdf(pdf, fieldCache, "Mark Storer", "mstorer"
        ));        
        zip.Save(stream);             
      }
    }
Пример #6
0
// ---------------------------------------------------------------------------
        public void Write(Stream stream)
        {
            using (ZipFile zip = new ZipFile()) {
                Subscribe subscribe = new Subscribe();
                byte[]    pdf       = subscribe.CreatePdf();
                zip.AddEntry(FORM, pdf);
                Dictionary <string, TextField> fieldCache =
                    new Dictionary <string, TextField>();
                zip.AddEntry(string.Format(RESULT, 1),
                             subscribe.ManipulatePdf(pdf, fieldCache, "Bruno Lowagie", "blowagie"
                                                     ));
                zip.AddEntry(string.Format(RESULT, 2),
                             subscribe.ManipulatePdf(pdf, fieldCache, "Paulo Soares", "psoares"
                                                     ));
                zip.AddEntry(string.Format(RESULT, 3),
                             subscribe.ManipulatePdf(pdf, fieldCache, "Mark Storer", "mstorer"
                                                     ));
                zip.Save(stream);
            }
        }
Пример #7
0
// ===========================================================================
    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);             
      }
    }