Example usage for com.itextpdf.text Document newPage

List of usage examples for com.itextpdf.text Document newPage

Introduction

In this page you can find the example usage for com.itextpdf.text Document newPage.

Prototype


public boolean newPage() 

Source Link

Document

Signals that an new page has to be started.

Usage

From source file:report.pdfs.Basics_PDF_Report.java

private void addContent(Document document) throws DocumentException {
    Anchor anchor = new Anchor("Table Report", catFont);
    anchor.setName("Table Report");

    // Second parameter is the number of the chapter
    Chapter catPart = new Chapter(new Paragraph(anchor), 1);

    Paragraph paragraph = new Paragraph();

    // Add a table
    document.add(new Paragraph());
    createTable(catPart);//from w  w w .j av a 2 s  . c  om

    // Now add all this to the document
    document.add(catPart);

    // Start a new page
    document.newPage();

    // Next section
    anchor = new Anchor("Second Chapter", catFont);
    anchor.setName("Second Chapter");

    // Second parameter is the number of the chapter
    catPart = new Chapter(new Paragraph(anchor), 2);

    // Add an image
    addEmptyLine(paragraph, 5);
    addBarChart(catPart);

    // Now add all this to the document
    document.add(catPart);

    // Start a new page
    document.newPage();

    // Next section
    anchor = new Anchor("Third Chapter", catFont);
    anchor.setName("Third Chapter");

    // Second parameter is the number of the chapter
    catPart = new Chapter(new Paragraph(anchor), 3);

    // Add an image
    addEmptyLine(paragraph, 5);
    addPieChart(catPart);

    // Now add all this to the document
    document.add(catPart);
}

From source file:report.pdfs.Feed_PDF_Report.java

private void addTitlePage(Document document) throws DocumentException {
    Paragraph preface = new Paragraph();
    // We add one empty line
    addEmptyLine(preface, 1);/*from w  w w .  j a  v  a 2s .c  o m*/
    // Lets write a big header
    preface.add(new Paragraph("Feed Overview", catFont));

    addEmptyLine(preface, 1);
    // Will create: Report generated by: _name, _date
    preface.add(new Paragraph("Report generated by: " + System.getProperty("user.name") + ", " + new Date(), //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-3$
            smallBold));
    addEmptyLine(preface, 3);
    preface.add(new Paragraph("This document describes something which is very important ", smallBold));

    addEmptyLine(preface, 8);

    preface.add(new Paragraph("This document is a preliminary version and not subject to "
            + "your license agreement or any other agreement with vogella.com ;-).", redFont));

    document.add(preface);
    // Start a new page
    document.newPage();
}

From source file:report.pdfs.Fertilizer_PDF_Report.java

private void addTitlePage(Document document) throws DocumentException {
    Paragraph preface = new Paragraph();
    // We add one empty line
    addEmptyLine(preface, 1);/*from   w ww . j av a 2 s.  c om*/
    // Lets write a big header
    preface.add(new Paragraph("Fertilizer Overview", catFont));

    addEmptyLine(preface, 1);
    // Will create: Report generated by: _name, _date
    preface.add(new Paragraph("Report generated by: " + System.getProperty("user.name") + ", " + new Date(), //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-3$
            smallBold));
    addEmptyLine(preface, 3);
    preface.add(new Paragraph("This document describes something which is very important ", smallBold));

    addEmptyLine(preface, 8);

    preface.add(new Paragraph("This document is a preliminary version and not subject to "
            + "your license agreement or any other agreement with vogella.com ;-).", redFont));

    document.add(preface);
    // Start a new page
    document.newPage();
}

From source file:report.pdfs.Gas_PDF_Report.java

private void addTitlePage(Document document) throws DocumentException {
    Paragraph preface = new Paragraph();
    // We add one empty line
    addEmptyLine(preface, 1);//from w  w w .j a  v a 2 s . c  om
    // Lets write a big header
    preface.add(new Paragraph("Gas Overview", catFont));

    addEmptyLine(preface, 1);
    // Will create: Report generated by: _name, _date
    preface.add(new Paragraph("Report generated by: " + System.getProperty("user.name") + ", " + new Date(), //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-3$
            smallBold));
    addEmptyLine(preface, 3);
    preface.add(new Paragraph("This document describes something which is very important ", smallBold));

    addEmptyLine(preface, 8);

    preface.add(new Paragraph("This document is a preliminary version and not subject to "
            + "your license agreement or any other agreement with vogella.com ;-).", redFont));

    document.add(preface);
    // Start a new page
    document.newPage();
}

From source file:report.pdfs.Herd_PDF_Report.java

private void addTitlePage(Document document) throws DocumentException {
    Paragraph preface = new Paragraph();
    // We add one empty line
    addEmptyLine(preface, 1);/*w ww  .  ja  v  a 2 s  .c  o  m*/
    // Lets write a big header
    preface.add(new Paragraph("Herd Overview", catFont));

    addEmptyLine(preface, 1);
    // Will create: Report generated by: _name, _date
    preface.add(new Paragraph("Report generated by: " + System.getProperty("user.name") + ", " + new Date(), //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-3$
            smallBold));
    addEmptyLine(preface, 3);
    preface.add(new Paragraph("This document describes something which is very important ", smallBold));

    addEmptyLine(preface, 8);

    preface.add(new Paragraph("This document is a preliminary version and not subject to "
            + "your license agreement or any other agreement with vogella.com ;-).", redFont));

    document.add(preface);
    // Start a new page
    document.newPage();
}

From source file:report.pdfs.Labour_PDF_Report.java

private void addTitlePage(Document document) throws DocumentException {
    Paragraph preface = new Paragraph();
    // We add one empty line
    addEmptyLine(preface, 1);//from w w  w .  ja  v a  2  s .c  o  m
    // Lets write a big header
    preface.add(new Paragraph("Labour Overview", catFont));

    addEmptyLine(preface, 1);
    // Will create: Report generated by: _name, _date
    preface.add(new Paragraph("Report generated by: " + System.getProperty("user.name") + ", " + new Date(), //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-3$
            smallBold));
    addEmptyLine(preface, 3);
    preface.add(new Paragraph("This document describes something which is very important ", smallBold));

    addEmptyLine(preface, 8);

    preface.add(new Paragraph("This document is a preliminary version and not subject to "
            + "your license agreement or any other agreement with vogella.com ;-).", redFont));

    document.add(preface);
    // Start a new page
    document.newPage();
}

From source file:report.pdfs.Lighting_PDF_Report.java

private void addTitlePage(Document document) throws DocumentException {
    Paragraph preface = new Paragraph();
    // We add one empty line
    addEmptyLine(preface, 1);/*from  www.ja v a2 s .co m*/
    // Lets write a big header
    preface.add(new Paragraph("Lighting Overview", catFont));

    addEmptyLine(preface, 1);
    // Will create: Report generated by: _name, _date
    preface.add(new Paragraph("Report generated by: " + System.getProperty("user.name") + ", " + new Date(), //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-3$
            smallBold));
    addEmptyLine(preface, 3);
    preface.add(new Paragraph("This document describes something which is very important ", smallBold));

    addEmptyLine(preface, 8);

    preface.add(new Paragraph("This document is a preliminary version and not subject to "
            + "your license agreement or any other agreement with vogella.com ;-).", redFont));

    document.add(preface);
    // Start a new page
    document.newPage();
}

From source file:report.pdfs.Machinery_PDF_Report.java

private void addTitlePage(Document document) throws DocumentException {
    Paragraph preface = new Paragraph();
    // We add one empty line
    addEmptyLine(preface, 1);/*w  w w.j a  v a 2 s  .c o m*/
    // Lets write a big header
    preface.add(new Paragraph("Machinery Overview", catFont));

    addEmptyLine(preface, 1);
    // Will create: Report generated by: _name, _date
    preface.add(new Paragraph("Report generated by: " + System.getProperty("user.name") + ", " + new Date(), //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-3$
            smallBold));
    addEmptyLine(preface, 3);
    preface.add(new Paragraph("This document describes something which is very important ", smallBold));

    addEmptyLine(preface, 8);

    preface.add(new Paragraph("This document is a preliminary version and not subject to "
            + "your license agreement or any other agreement with vogella.com ;-).", redFont));

    document.add(preface);
    // Start a new page
    document.newPage();
}

From source file:report.pdfs.Medical_PDF_Report.java

private void addTitlePage(Document document) throws DocumentException {
    Paragraph preface = new Paragraph();
    // We add one empty line
    addEmptyLine(preface, 1);/*from   w  w w.j ava 2 s  . c o m*/
    // Lets write a big header
    preface.add(new Paragraph("Medical Overview", catFont));

    addEmptyLine(preface, 1);
    // Will create: Report generated by: _name, _date
    preface.add(new Paragraph("Report generated by: " + System.getProperty("user.name") + ", " + new Date(), //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-3$
            smallBold));
    addEmptyLine(preface, 3);
    preface.add(new Paragraph("This document describes something which is very important ", smallBold));

    addEmptyLine(preface, 8);

    preface.add(new Paragraph("This document is a preliminary version and not subject to "
            + "your license agreement or any other agreement with vogella.com ;-).", redFont));

    document.add(preface);
    // Start a new page
    document.newPage();
}

From source file:report.pdfs.Mortgaged_PDF_Report.java

private void addTitlePage(Document document) throws DocumentException {
    Paragraph preface = new Paragraph();
    // We add one empty line
    addEmptyLine(preface, 1);// ww  w. j  a v a  2  s .c  o m
    // Lets write a big header
    preface.add(new Paragraph("Mortgaged Overview", catFont));

    addEmptyLine(preface, 1);
    // Will create: Report generated by: _name, _date
    preface.add(new Paragraph("Report generated by: " + System.getProperty("user.name") + ", " + new Date(), //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-3$
            smallBold));
    addEmptyLine(preface, 3);
    preface.add(new Paragraph("This document describes something which is very important ", smallBold));

    addEmptyLine(preface, 8);

    preface.add(new Paragraph("This document is a preliminary version and not subject to "
            + "your license agreement or any other agreement with vogella.com ;-).", redFont));

    document.add(preface);
    // Start a new page
    document.newPage();
}