예제 #1
0
// ---------------------------------------------------------------------------    
    public void Write(Stream stream) {
      HelloWorld hello = new HelloWorld();
      Hero1 hero = new Hero1();
      using (ZipFile zip = new ZipFile()) {
        byte[] pdfHello = Utility.PdfBytes(hello);
        byte[] pdfHero = Utility.PdfBytes(hero);
        zip.AddEntry(Utility.ResultFileName(
          hello.ToString() + ".pdf"), pdfHello
        );       
        zip.AddEntry(Utility.ResultFileName(
          hero.ToString() + ".pdf"), pdfHero
        );
        GetContentStream example = new GetContentStream();
        zip.AddEntry(RESULT1, example.ReadContent(pdfHello));
        zip.AddEntry(RESULT2, example.ReadContent(pdfHero));
        zip.Save(stream);             
      }    
    }
예제 #2
0
// ---------------------------------------------------------------------------
        public void Write(Stream stream)
        {
            HelloWorld hello = new HelloWorld();
            Hero1      hero  = new Hero1();

            using (ZipFile zip = new ZipFile()) {
                byte[] pdfHello = Utility.PdfBytes(hello);
                byte[] pdfHero  = Utility.PdfBytes(hero);
                zip.AddEntry(Utility.ResultFileName(
                                 hello.ToString() + ".pdf"), pdfHello
                             );
                zip.AddEntry(Utility.ResultFileName(
                                 hero.ToString() + ".pdf"), pdfHero
                             );
                GetContentStream example = new GetContentStream();
                zip.AddEntry(RESULT1, example.ReadContent(pdfHello));
                zip.AddEntry(RESULT2, example.ReadContent(pdfHero));
                zip.Save(stream);
            }
        }