Example usage for com.itextpdf.text Phrase Phrase

List of usage examples for com.itextpdf.text Phrase Phrase

Introduction

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

Prototype

public Phrase(final float leading, final String string) 

Source Link

Document

Constructs a Phrase with a certain leading and a certain String.

Usage

From source file:com.planning.project.controller.CreatePDF.java

public static PdfPTable createtableMaterial3(List<TbMaterial> tbMaterials3, String getSum)
        throws DocumentException, Exception {

    Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED));
    font.setSize(16);//from  w  w  w.j a v  a  2 s.com

    PdfPTable table = new PdfPTable(6);
    table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
    table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
    PdfPCell cell = new PdfPCell(
            new Phrase("3.3 ", font));
    cell.setColspan(6);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase(" = " + getSum + " ", font));
    cell.setColspan(6);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("??", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    int count = 0;
    for (TbMaterial items : tbMaterials3) {
        count++;
        table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMName(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMQty(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMNub(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMPrice(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMTotal(), font)));
    }
    return table;
}

From source file:com.planning.project.controller.CreatePDF.java

public static PdfPTable createtableMaterial4(List<TbMaterial> tbMaterials4, String getSum)
        throws DocumentException, Exception {

    Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED));
    font.setSize(16);/*from w ww .j  av a 2 s. co  m*/

    PdfPTable table = new PdfPTable(6);
    table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
    table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
    PdfPCell cell = new PdfPCell(
            new Phrase("3.4 ?", font));
    cell.setColspan(6);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase(" = " + getSum + " ", font));
    cell.setColspan(6);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("??", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    int count = 0;
    for (TbMaterial items : tbMaterials4) {
        count++;
        table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMName(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMQty(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMNub(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMPrice(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMTotal(), font)));
    }
    return table;
}

From source file:com.planning.project.controller.CreatePDF.java

public static PdfPTable createtableMaterial5(List<TbMaterial> tbMaterials5, String getSum)
        throws DocumentException, Exception {

    Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED));
    font.setSize(16);//  ww  w . j  av  a  2s  . co  m

    PdfPTable table = new PdfPTable(6);
    table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
    table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
    PdfPCell cell = new PdfPCell(new Phrase(
            "3.5 ??",
            font));
    cell.setColspan(6);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase(" = " + getSum + " ", font));
    cell.setColspan(6);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("??", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    int count = 0;
    for (TbMaterial items : tbMaterials5) {
        count++;
        table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMName(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMQty(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMNub(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMPrice(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMTotal(), font)));
    }
    return table;
}

From source file:com.planning.project.controller.CreatePDF.java

public static PdfPTable createtableMaterial6(List<TbMaterial> tbMaterials6, String getSum)
        throws DocumentException, Exception {

    Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED));
    font.setSize(16);/*from www .  j a  v  a  2  s. c o  m*/

    PdfPTable table = new PdfPTable(6);
    table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
    table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
    PdfPCell cell = new PdfPCell(new Phrase("3.6 ??", font));
    cell.setColspan(6);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase(" = " + getSum + " ", font));
    cell.setColspan(6);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("??", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    int count = 0;
    for (TbMaterial items : tbMaterials6) {
        count++;
        table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMName(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMQty(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMNub(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMPrice(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMTotal(), font)));
    }
    return table;
}

From source file:com.planning.project.controller.CreatePDF.java

public static PdfPTable createtableMaterial7(List<TbMaterial> tbMaterials7, String getSum)
        throws DocumentException, Exception {

    Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED));
    font.setSize(16);//  w ww .jav  a  2  s  .  c  o  m

    PdfPTable table = new PdfPTable(6);
    table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
    table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
    PdfPCell cell = new PdfPCell(new Phrase("3.7 ", font));
    cell.setColspan(6);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase(" = " + getSum + " ", font));
    cell.setColspan(6);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("??", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    int count = 0;
    for (TbMaterial items : tbMaterials7) {
        count++;
        table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMName(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMQty(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMNub(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMPrice(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMTotal(), font)));
    }
    return table;
}

From source file:com.planning.project.controller.CreatePDF.java

public static PdfPTable createtableMaterial8(List<TbMaterial> tbMaterials8, String getSum)
        throws DocumentException, Exception {

    Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED));
    font.setSize(16);//from  w  ww . j ava2  s  . c o  m

    PdfPTable table = new PdfPTable(6);
    table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
    table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
    PdfPCell cell = new PdfPCell(new Phrase("3.8 ??", font));
    cell.setColspan(6);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase(" = " + getSum + " ", font));
    cell.setColspan(6);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("??", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    int count = 0;
    for (TbMaterial items : tbMaterials8) {
        count++;
        table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMName(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMQty(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMNub(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMPrice(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMTotal(), font)));
    }
    return table;
}

From source file:com.planning.project.controller.CreatePDF.java

public static PdfPTable createtableMaterial9(List<TbMaterial> tbMaterials9, String getSum)
        throws DocumentException, Exception {

    Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED));
    font.setSize(16);//w w  w.j a v a  2 s.  com

    PdfPTable table = new PdfPTable(6);
    table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
    table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
    PdfPCell cell = new PdfPCell(
            new Phrase("3.9 ", font));
    cell.setColspan(6);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase(" = " + getSum + " ", font));
    cell.setColspan(6);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("??", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    int count = 0;
    for (TbMaterial items : tbMaterials9) {
        count++;
        table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMName(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMQty(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMNub(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMPrice(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMTotal(), font)));
    }
    return table;
}

From source file:com.planning.project.controller.CreatePDF.java

public static PdfPTable createtableMaterial10(List<TbMaterial> tbMaterials10, String getSum)
        throws DocumentException, Exception {

    Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED));
    font.setSize(16);/*  w ww. ja v a  2  s  . com*/

    PdfPTable table = new PdfPTable(6);
    table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
    table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
    PdfPCell cell = new PdfPCell(
            new Phrase("3.10 ???", font));
    cell.setColspan(6);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase(" = " + getSum + " ", font));
    cell.setColspan(6);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("??", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    int count = 0;
    for (TbMaterial items : tbMaterials10) {
        count++;
        table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMName(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMQty(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMNub(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMPrice(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMTotal(), font)));
    }
    return table;
}

From source file:com.planning.project.controller.CreatePDF.java

public static PdfPTable createtableMaterial11(List<TbMaterial> tbMaterials11, String getSum)
        throws DocumentException, Exception {

    Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED));
    font.setSize(16);/* w  ww . j  a v  a2  s  .  c o  m*/

    PdfPTable table = new PdfPTable(6);
    table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
    table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
    PdfPCell cell = new PdfPCell(new Phrase("3.11 ", font));
    cell.setColspan(6);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase(" = " + getSum + " ", font));
    cell.setColspan(6);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("??", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    int count = 0;
    for (TbMaterial items : tbMaterials11) {
        count++;
        table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMName(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMQty(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMNub(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMPrice(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMTotal(), font)));
    }
    return table;
}

From source file:com.planning.project.controller.CreatePDF.java

public static PdfPTable createtablePublicutility(List<TbPublicutility> tbPublicutilitys, String getSum)
        throws DocumentException, Exception {

    Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED));
    font.setSize(16);//from  w w w  .  j av  a2  s.c om

    PdfPTable table = new PdfPTable(6);
    table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
    table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
    PdfPCell cell = new PdfPCell(
            new Phrase("4.1 ?", font));
    cell.setColspan(6);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase(" = " + getSum + " ", font));
    cell.setColspan(6);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase("", font));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(cell);
    int count = 0;
    for (TbPublicutility items : tbPublicutilitys) {
        count++;
        table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font)));
        table.addCell(new PdfPCell(new Phrase(items.getPubEle(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getPubWater(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getPubTel(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getPubEms(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getPubOther(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getPubSum(), font)));
    }
    return table;
}