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 createtableRentalproperty(List<TbRentalproperty> tbRentalpropertys, 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 .jav  a  2 s  . c o m

    PdfPTable table = new PdfPTable(4);
    table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
    table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
    PdfPCell cell = new PdfPCell(new Phrase("2.7 ", font));
    cell.setColspan(4);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase(" = " + getSum + " ", font));
    cell.setColspan(4);
    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 (TbRentalproperty items : tbRentalpropertys) {
        count++;
        table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font)));
        table.addCell(new PdfPCell(new Phrase(items.getDetailrental(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getNamerental(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMoney(), font)));
    }
    return table;
}

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

public static PdfPTable createtableThecertificationfood(List<TbThecertificationfood> tbThecertificationfoods,
        String getSum) throws DocumentException, Exception {

    Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED));
    font.setSize(16);/*from ww w  . j av a2 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("2.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 (TbThecertificationfood items : tbThecertificationfoods) {
        count++;
        table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font)));
        table.addCell(new PdfPCell(new Phrase(items.getDetail(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getQuantityperson(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getQuantitymoney(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getQuantitytime(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getSum(), font)));
    }
    return table;
}

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

public static PdfPTable createtableThecertificationdrinks(
        List<TbThecertificationdrink> tbThecertificationdrinks, 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  va2 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(
            "2.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 (TbThecertificationdrink items : tbThecertificationdrinks) {
        count++;
        table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font)));
        table.addCell(new PdfPCell(new Phrase(items.getDetail(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getQuantityperson(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getQuantitymoney(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getQuantitytime(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getSum(), font)));
    }
    return table;
}

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

public static PdfPTable createtableThegift(List<TbThegift> tbThegifts, 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.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(
            "2.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 (TbThegift items : tbThegifts) {
        count++;
        table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font)));
        table.addCell(new PdfPCell(new Phrase(items.getDetail(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getQuantityperson(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getQuantitymoney(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getQuantitytime(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMoneytotal(), font)));
    }
    return table;
}

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

public static PdfPTable createtableTax(List<TbTax> tbTaxs, 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  .ja  v a2  s.  co m

    PdfPTable table = new PdfPTable(5);
    table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
    table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
    PdfPCell cell = new PdfPCell(new Phrase("2.11 ", font));
    cell.setColspan(5);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase(" = " + getSum + " ", font));
    cell.setColspan(5);
    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 (TbTax items : tbTaxs) {
        count++;
        table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font)));
        table.addCell(new PdfPCell(new Phrase(items.getDetail(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMoney(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getTime(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMoneytotal(), font)));
    }
    return table;
}

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

public static PdfPTable createtableFee(List<TbFee> tbFees, 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 ava  2s . com

    PdfPTable table = new PdfPTable(5);
    table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
    table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
    PdfPCell cell = new PdfPCell(new Phrase("2.12 ", font));
    cell.setColspan(5);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase(" = " + getSum + " ", font));
    cell.setColspan(5);
    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 (TbFee items : tbFees) {
        count++;
        table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font)));
        table.addCell(new PdfPCell(new Phrase(items.getDetail(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMoney(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getTime(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMoneytotal(), font)));
    }
    return table;
}

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

public static PdfPTable createtableInsurance(List<TbInsurance> tbInsurances, 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.  ja  v a2 s.  co m*/

    PdfPTable table = new PdfPTable(5);
    table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
    table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
    PdfPCell cell = new PdfPCell(new Phrase("2.13 ?", font));
    cell.setColspan(5);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase(" = " + getSum + " ", font));
    cell.setColspan(5);
    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 (TbInsurance items : tbInsurances) {
        count++;
        table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font)));
        table.addCell(new PdfPCell(new Phrase(items.getDetail(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMoney(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getTime(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMoneytotal(), font)));
    }
    return table;
}

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

public static PdfPTable createtableEmploy(List<TbEmploy> tbEmploys, 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 ava 2  s.c o  m*/

    PdfPTable table = new PdfPTable(4);
    table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
    table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
    PdfPCell cell = new PdfPCell(new Phrase("2.14 ", font));
    cell.setColspan(4);
    table.addCell(cell);
    cell = new PdfPCell(new Phrase(" = " + getSum + " ", font));
    cell.setColspan(4);
    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 (TbEmploy items : tbEmploys) {
        count++;
        table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font)));
        table.addCell(new PdfPCell(new Phrase(items.getEmploymoney(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getDetail(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getCalculation(), font)));
    }
    return table;
}

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

public static PdfPTable createtableMaterial1(List<TbMaterial> tbMaterials1, 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 va  2 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("3.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 (TbMaterial items : tbMaterials1) {
        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 createtableMaterial2(List<TbMaterial> tbMaterials2, 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 . ja  v a2s.  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("3.2 ?", 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 : tbMaterials2) {
        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;
}