title: How to get new page in iText
body: <p>Its bit problmatic to go for new page with <code>pdfContentByte</code>.I'm using below code to put data after first page to next page but unfortunately <code>iText</code> is not generating new page.</p>
  
  <pre><code>//step1
      itextDocument = new com.itextpdf.text.Document(PageSize.A4, 50, 50, 30, 65);
      writer = PdfWriter.getInstance(itextDocument, new FileOutputStream(RESULT));
      itextDocument.open();
      writer.setPageEmpty(true);
      itextDocument.newPage();
  
  
      // step 2 == design and set the postions
  
  
      // Measuring a String in Helvetica
      Font font = new Font(FontFamily.TIMES_ROMAN, 10);
      BaseFont romanFont = font.getCalculatedBaseFont(false);
  
  
      // Drawing lines to see where the text is added
      PdfContentByte canvas = writer.getDirectContent();
      canvas.saveState();
  
  
  
  
       canvas.stroke();
          canvas.restoreState();
          // Adding text with PdfContentByte.showTextAligned()
          canvas.beginText();
          canvas.setFontAndSize(romanFont, 10);
  
          //===================  get data from xml and put in pdf 
          createPDF(xmlDoc, canvas);
  
  
  
          createPDF(xmlDoc, canvas){
               for(int i=0;i&lt;300;i++){
                  contentByte.showTextAligned(Element.ALIGN_LEFT, "sample value", flotX, flotY, 0); 
               }
           }
  
      static int flotX = 50;
      static int flotY = 800;
  </code></pre>
  
  <p>how can I generate new page? Any suggestion.</p>