Example usage for com.itextpdf.text.pdf BaseFont EMBEDDED

List of usage examples for com.itextpdf.text.pdf BaseFont EMBEDDED

Introduction

In this page you can find the example usage for com.itextpdf.text.pdf BaseFont EMBEDDED.

Prototype

boolean EMBEDDED

To view the source code for com.itextpdf.text.pdf BaseFont EMBEDDED.

Click Source Link

Document

if the font has to be embedded

Usage

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

public static PdfPTable createtableRentshouse(List<TbRentshouse> tbRentshouses, String getSumRentshouses)
        throws DocumentException, Exception {

    Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED));
    font.setSize(16);//from ww w .java 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("1.5 ", font));
    cell.setColspan(4);
    table.addCell(cell);
    cell = new PdfPCell(
            new Phrase(" = " + getSumRentshouses + " ", 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 (TbRentshouse items : tbRentshouses) {
        count++;
        table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font)));
        table.addCell(new PdfPCell(new Phrase(
                items.getTbPerson().getPersonName() + " " + items.getTbPerson().getPersonLastname(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getRentshousePrice(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getRentshouseSum(), font)));
    }
    return table;
}

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

public static PdfPTable createtableTeachextra(List<TbTeachextra> tbTeachextras, String getSumTeachextra)
        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 a2  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(
            "1.6 ??? ()",
            font));
    cell.setColspan(6);
    table.addCell(cell);
    cell = new PdfPCell(
            new Phrase(" = " + getSumTeachextra + " ", 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 (TbTeachextra items : tbTeachextras) {
        count++;
        table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font)));
        table.addCell(new PdfPCell(new Phrase(items.getTtPerson(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getTtHour(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getTtWeek(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getTtBath(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getTtSum(), font)));
    }
    return table;
}

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

public static PdfPTable createtableExpenpaper(List<TbExpenpaper> tbExpenpapers, 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 2s .c  o  m

    PdfPTable table = new PdfPTable(5);
    table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
    table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
    PdfPCell cell = new PdfPCell(new Phrase(
            "1.6 ??? (?)",
            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 (TbExpenpaper items : tbExpenpapers) {
        count++;
        table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font)));
        table.addCell(new PdfPCell(new Phrase(items.getEpQty(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getEpMany(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getEpPrice(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getEpSum(), font)));
    }
    return table;
}

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

public static PdfPTable createtableComlecturer(List<TbComlecturer> tbComlecturers, 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(6);
    table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
    table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
    PdfPCell cell = new PdfPCell(new Phrase(
            "1.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 (TbComlecturer items : tbComlecturers) {
        count++;
        table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font)));
        table.addCell(new PdfPCell(new Phrase(items.getClTopic(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getClPerson(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getClMany(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getClBath(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getClSum(), font)));
    }
    return table;
}

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

public static PdfPTable createtableOthercompensation(List<TbOthercompensation> tbOthercompensations,
        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(4);
    table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
    table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
    PdfPCell cell = new PdfPCell(new Phrase("1.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 (TbOthercompensation items : tbOthercompensations) {
        count++;
        table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMoney(), 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 createtableAllowancesrental(List<TbAllowancesrental> tbAllowancesrentals, 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  ava2 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(
            "2.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 (TbAllowancesrental items : tbAllowancesrentals) {
        count++;
        table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font)));
        table.addCell(new PdfPCell(new Phrase(items.getAllowancesmoneytotal(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getAccommodationmoneytotal(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getTravelingexpensesmoneytotal(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getRemark(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getSum(), font)));
    }
    return table;
}

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

public static PdfPTable createtableGasolineDetail(List<TbGasolineDetail> tbGasolineDetails, String getSum)
        throws DocumentException, Exception {

    Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED));
    font.setSize(16);/* www.ja va2  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.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 (TbGasolineDetail items : tbGasolineDetails) {
        count++;
        table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font)));
        table.addCell(new PdfPCell(new Phrase(items.getTbcar().getCarNumberlicense(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getTbCarStatus().getCarStatusName(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getPriceRepaircar(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getPriceGasoline(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getTotal(), font)));
    }
    return table;
}

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

public static PdfPTable createtableRepairofequipment(List<TbRepairofequipment> tbRepairofequipments,
        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  a2 s .c o 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.3 ?", 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 (TbRepairofequipment items : tbRepairofequipments) {
        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.getQuantity(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getPrice(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getTotal(), font)));
    }
    return table;
}

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

public static PdfPTable createtableWageservice(List<TbWageservice> tbWageservices, 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  . 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.4 ?", 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 (TbWageservice items : tbWageservices) {
        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.getChartertime_(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getChartermoney(), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMoneytotal(), font)));
    }
    return table;
}

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

public static PdfPTable createtableMeetingofthesnack(List<TbMeetingofthesnack> tbMeetingofthesnacks,
        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 va 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("2.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 (TbMeetingofthesnack items : tbMeetingofthesnacks) {
        count++;
        table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font)));
        table.addCell(new PdfPCell(new Phrase(items.getMeetingofthesnackmoney(), 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;
}