Example usage for com.itextpdf.text Chapter addSection

List of usage examples for com.itextpdf.text Chapter addSection

Introduction

In this page you can find the example usage for com.itextpdf.text Chapter addSection.

Prototype

public Section addSection(final Paragraph title) 

Source Link

Document

Creates a Section, adds it to this Section and returns it.

Usage

From source file:org.sharegov.cirm.utils.PDFViewReport.java

License:Apache License

private Section addSection(Chapter chapter) {
    Section section = chapter.addSection(new Paragraph());
    section.setNumberDepth(0);/*from  w w  w.  j a  v  a  2s  .  c  o  m*/
    return section;
}

From source file:org.tvd.thptty.management.util.Report.java

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

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

    Paragraph subPara = new Paragraph("Subcategory 1", subFont);
    Section subCatPart = catPart.addSection(subPara);
    subCatPart.add(new Paragraph("Hello"));

    subPara = new Paragraph("Subcategory 2", subFont);
    subCatPart = catPart.addSection(subPara);
    subCatPart.add(new Paragraph("Paragraph 1"));
    subCatPart.add(new Paragraph("Paragraph 2"));
    subCatPart.add(new Paragraph("Paragraph 3"));

    // Add a list
    createList(subCatPart);//from w w  w . ja v a  2  s. com
    Paragraph paragraph = new Paragraph();
    addEmptyLine(paragraph, 5);

    paragraph.setFont(smallBold);
    // Add a table
    paragraph.add(createTable(subCatPart));
    subCatPart.add(paragraph);

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

    // 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), 1);

    subPara = new Paragraph("Subcategory", subFont);
    subCatPart = catPart.addSection(subPara);
    subCatPart.add(new Paragraph("This is a very important message"));

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

}

From source file:others.pdfWriter.java

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

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

    Paragraph subPara = new Paragraph("Subcategory 1", subFont);
    Section subCatPart = catPart.addSection(subPara);
    subCatPart.add(new Paragraph("Hello"));

    subPara = new Paragraph("Subcategory 2", subFont);
    subCatPart = catPart.addSection(subPara);
    subCatPart.add(new Paragraph("Paragraph 1"));
    subCatPart.add(new Paragraph("Paragraph 2"));
    subCatPart.add(new Paragraph("Paragraph 3"));

    // add a list
    createList(subCatPart);/*ww  w.  j  a  v a 2s .  c om*/
    Paragraph paragraph = new Paragraph();
    addEmptyLine(paragraph, 5);
    subCatPart.add(paragraph);

    // add a table
    //    createTableExercicios(subCatPart);

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

    // 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), 1);

    subPara = new Paragraph("Subcategory", subFont);
    subCatPart = catPart.addSection(subPara);
    subCatPart.add(new Paragraph("This is a very important message"));

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

}

From source file:pdf.PDFdescriptiva.java

private static void agregarContenido(Document document, String titulo, String[][] arreglo, Integer N,
        String[] variables) throws DocumentException {

    agregarTabla(document, titulo, arreglo);

    Anchor anchor = new Anchor("Datos", catFont);
    anchor.setName("Datos");
    Chapter catPart = new Chapter(new Paragraph(anchor), 1);

    Paragraph subPara = new Paragraph("Variables", subFont);
    Section subCatPart = catPart.addSection(subPara);
    subCatPart.add(new Paragraph("N: " + N));
    subCatPart.add(new Paragraph("Maximo: " + variables[0]));
    subCatPart.add(new Paragraph("Minimo: " + variables[1]));
    subCatPart.add(new Paragraph("Rango: " + variables[2]));
    subCatPart.add(new Paragraph("Intervalos: " + variables[3]));
    subCatPart.add(new Paragraph("Amplitud: " + variables[4]));
    subCatPart.add(new Paragraph("Rango Ampliado: " + variables[5]));
    subCatPart.add(new Paragraph("Dif Rangos: " + variables[6]));
    subCatPart.add(new Paragraph("LIPI: " + variables[7]));
    subCatPart.add(new Paragraph("LSUI: " + variables[8]));
    subCatPart.add(new Paragraph("Desv Media: " + variables[9]));
    subCatPart.add(new Paragraph("Varianza: " + variables[10]));
    subCatPart.add(new Paragraph("Desv Estandar: " + variables[11]));
    subCatPart.add(new Paragraph("Media: " + variables[12]));
    subCatPart.add(new Paragraph("Mediana: " + variables[13]));
    subCatPart.add(new Paragraph("Moda: " + variables[14]));

    document.add(catPart);/*from  ww  w. ja  va  2 s .co  m*/
}

From source file:pdf.PDFmultiple.java

private static void agregarContenido(Document document, String titulo, String[][] arreglo, Integer N, Double b0,
        Double b1, Double b2, Double Se, Double[] prediccion) throws DocumentException {

    agregarTabla(document, titulo, arreglo);

    Anchor anchor = new Anchor("Datos", catFont);
    anchor.setName("Datos");
    Chapter catPart = new Chapter(new Paragraph(anchor), 1);

    Paragraph subPara = new Paragraph("Variables", subFont);
    Section subCatPart = catPart.addSection(subPara);
    subCatPart.add(new Paragraph("N: " + N));
    subCatPart.add(new Paragraph("K: 2"));
    subCatPart.add(new Paragraph("b0: " + b0));
    subCatPart.add(new Paragraph("b1: " + b1));
    subCatPart.add(new Paragraph("b2: " + b2));
    subCatPart.add(new Paragraph("Se: " + Se));
    Paragraph espacio = new Paragraph();
    addEmptyLine(espacio, 1);/*from w  ww .jav  a  2 s . c o m*/
    subCatPart.add(espacio);
    subPara = new Paragraph("Predicciones", subFont);
    subCatPart = catPart.addSection(subPara);
    if (prediccion[0] != null && prediccion[1] != null && prediccion[2] != null && prediccion[3] != null
            && prediccion[4] != null && prediccion[5] != null) {
        subCatPart.add(new Paragraph("X1: " + prediccion[0]));
        subCatPart.add(new Paragraph("X2: " + prediccion[1]));
        subCatPart.add(new Paragraph("Efectividad: " + prediccion[2]));
        addEmptyLine(espacio, 1);
        subCatPart.add(espacio);
        tablaPrediccion(subCatPart, prediccion[3], prediccion[4], prediccion[5]);
    } else {
        subCatPart.add(new Paragraph("No se realiz ninguna prediccion."));
    }

    document.add(catPart);
}

From source file:pdf.PDFsimple.java

private static void agregarContenido(Document document, String titulo, String[][] arreglo, Integer N, Double b0,
        Double b1, Double Se, Double dx, Double dy, Double dxy, Double r, Double[] prediccion)
        throws DocumentException {

    agregarTabla(document, titulo, arreglo);

    Anchor anchor = new Anchor("Datos", catFont);
    anchor.setName("Datos");
    Chapter catPart = new Chapter(new Paragraph(anchor), 1);
    //comentario/*from  w w w  .  j a v a 2 s . c  om*/
    Paragraph subPara = new Paragraph("Variables", subFont);
    Section subCatPart = catPart.addSection(subPara);
    subCatPart.add(new Paragraph("N: " + N));
    subCatPart.add(new Paragraph("K: 1"));
    subCatPart.add(new Paragraph("b0: " + b0));
    subCatPart.add(new Paragraph("b1: " + b1));
    subCatPart.add(new Paragraph("Se: " + Se));
    subCatPart.add(new Paragraph("DX: " + dx));
    subCatPart.add(new Paragraph("DY: " + dy));
    subCatPart.add(new Paragraph("DXY: " + dxy));
    subCatPart.add(new Paragraph("R: " + r));
    Paragraph espacio = new Paragraph();
    addEmptyLine(espacio, 1);
    subCatPart.add(espacio);
    subPara = new Paragraph("Predicciones", subFont);
    subCatPart = catPart.addSection(subPara);
    if (prediccion[0] != null && prediccion[1] != null && prediccion[2] != null && prediccion[3] != null
            && prediccion[4] != null) {
        subCatPart.add(new Paragraph("X: " + prediccion[0]));
        subCatPart.add(new Paragraph("Efectividad: " + prediccion[1]));
        addEmptyLine(espacio, 1);
        subCatPart.add(espacio);
        tablaPrediccion(subCatPart, prediccion[2], prediccion[3], prediccion[4]);
    } else {
        subCatPart.add(new Paragraph("No se realiz ninguna prediccion."));
    }

    document.add(catPart);
}

From source file:pdfgen.pdf_generation_try5.java

public void addContent(Document document) throws DocumentException {
    Anchor anchor = new Anchor("Chapter 1: used for various paragraphs", catFont);
    anchor.setName("First Chapter");

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

    Paragraph subPara = new Paragraph("Subcategory 1", subFont);
    Section subCatPart = catPart.addSection(subPara);
    subCatPart.add(new Paragraph("Hello"));

    subPara = new Paragraph("Subcategory 2", subFont);
    subCatPart = catPart.addSection(subPara);
    subCatPart.add(new Paragraph("Paragraph 1"));
    subCatPart.add(new Paragraph("Paragraph 2"));
    subCatPart.add(new Paragraph("Paragraph 3"));

    // add a list
    createList(subCatPart);/*from   ww w .j  a v  a2  s .  c o  m*/
    Paragraph paragraph = new Paragraph();
    addEmptyLine(paragraph, 5);
    subCatPart.add(paragraph);

    // add a table
    createTable(subCatPart);

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

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

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

    subPara = new Paragraph("Subcategory", subFont);
    subCatPart = catPart.addSection(subPara);
    subCatPart.add(new Paragraph("This is a very important message"));

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

}

From source file:sipl.recursos.GenerarPDFGrafica.java

private void addContent(Document document) throws DocumentException {
    Anchor anchor = new Anchor(Titulo, catFont);
    anchor.setName(Titulo);//from w  w  w  .  j  a  va2  s .co  m
    Chapter catPart = new Chapter(new Paragraph(anchor), 1);
    Paragraph subPara = new Paragraph("", subFont);
    Section subCatPart = catPart.addSection(subPara);
    createTable(subCatPart);
    String p = Titulo.charAt(0) + "";
    if (p.equals("M")) {
        subPara = new Paragraph("", subFont);
        subCatPart = catPart.addSection(subPara);
        createTable2(subCatPart);
    }
    document.add(catPart);
}

From source file:sipl.recursos.GenerarPDFListar.java

private void addContent(Document document) throws DocumentException {
    Anchor anchor = new Anchor(Titulo, catFont);
    anchor.setName(Titulo);//from   w  w w. ja v a  2  s  . c  o m
    Chapter catPart = new Chapter(new Paragraph(anchor), 1);
    Paragraph subPara = new Paragraph("", subFont);
    Section subCatPart = catPart.addSection(subPara);
    createTable(subCatPart);
    document.add(catPart);
}

From source file:sipl.recursos.GenerarPDFtipomaterial.java

private static void addContent(Document document) throws DocumentException {
    Anchor anchor = new Anchor(Titulo, catFont);
    anchor.setName(Titulo);//from  w  w w . j  av  a  2  s.c  o  m
    Chapter catPart = new Chapter(new Paragraph(anchor), 1);
    Paragraph subPara = new Paragraph("", subFont);
    Section subCatPart = catPart.addSection(subPara);
    createTable(subCatPart);
    document.add(catPart);
}