Starting a new Page : New Page « PDF RTF « Java






Starting a new Page

Starting a new Page
import java.io.FileOutputStream;

import com.lowagie.text.Chunk;
import com.lowagie.text.Document;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.PdfWriter;

public class NewPageToStartANewPagePDF {
  public static void main(String[] args) {
    Document document = new Document();
    try {
      PdfWriter.getInstance(document, new FileOutputStream("NewPageToStartANewPagePDF.pdf"));
      document.open();

      document.add(new Paragraph("A"));
      document.newPage();
      document.add(new Paragraph("B"));
      document.newPage();
      document.newPage();
      document.newPage();
      document.add(new Paragraph("C"));
    } catch (Exception ioe) {
      System.err.println(ioe.getMessage());
    }
    document.close();
  }
}
           
       








itext.zip( 1,748 k)

Related examples in the same category

1.Adding: NewPage, Chunk.NEXTPAGEAdding: NewPage, Chunk.NEXTPAGE
2.New Empty PageNew Empty Page
3.Creating a New Page for PDF documentCreating a New Page for PDF document