title: zip a pdf file created using itext
body: <pre><code>    response.setHeader("Content-Disposition", "attachment; filename=r.pdf");
      Document document1 = new Document(PageSize.A4);
      PdfWriter pdfWriter=PdfWriter.getInstance(document1, response.getOutputStream());
      pdfWriter.setPageEvent(new HeaderAndFooter(name));
     try{
       document1.open();
        XMLWorkerHelper worker1 = XMLWorkerHelper.getInstance();
        long seed =123;
        Random rnd = new Random (seed); 
        Collections.shuffle(arrlist1,rnd); 
        for(int i=0;i&lt;nb;i++){
        String str =(String) arrlist1.get(i);
        worker1.parseXHtml(pdfWriter, document1, new StringReader(str));
    }
    }catch(Exception e){e.printStackTrace();}
    document1.close();
     pdfWriter.flush();
     pdfWriter.close();
     multi.finish();
   %&gt;
  </code></pre>
  
  <p>I have this code where a pdf page is created,I would like to know how to zip it??
  I found this code on some1's post </p>
  
  <pre><code>var zip = new JSZip();
  zip.file("Hello.txt", "Hello World\n");
  var img = zip.folder("images");
  img.file("smile.gif", imgData, {base64: true});
  var content = zip.generate();
  location.href="data:application/zip;base64,"+content;
  </code></pre>
  
  <p>but dont know how to apply it to mine?</p>