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

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

Introduction

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

Prototype

public static BaseFont createFont(String name, String encoding, boolean embedded)
        throws DocumentException, IOException 

Source Link

Document

Creates a new font.

Usage

From source file:com.norbsoft.pdfconverter.helpers.PDFHelper.java

License:Open Source License

public PDFHelper(Context context, String fontUrl) {
    this.context = context;
    try {//from w  w  w .j ava2  s . co  m
        baseFont = BaseFont.createFont(fontUrl, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
    } catch (DocumentException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }
    normal = new Font(baseFont, 10, Font.NORMAL);
    bold = new Font(baseFont, 10, Font.BOLD);
    strike = new Font(baseFont, 10, Font.STRIKETHRU);

}

From source file:com.northcoders.controller.BookingReportsController.java

@FXML
private void generatePdf() throws Exception {
    BaseFont bf;//  w w  w .  ja  va2 s.  c  o m
    Font font;
    try {
        conditions = "Filtered by: Start Date:2017-03-15 End Date:2017-03-28";

        /* Step-2: Initialize PDF documents - logical objects */
        Document my_pdf_report = new Document(PageSize.LETTER.rotate());
        PdfWriter.getInstance(my_pdf_report, new FileOutputStream("pdf_booking_report.pdf"));
        my_pdf_report.open();
        //we have four columns in our table
        PdfPTable my_report_table = new PdfPTable(6);
        //create a cell object
        PdfPCell table_cell;

        bf = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.EMBEDDED);
        font = new Font(bf, 16);
        my_pdf_report.add(new Paragraph("Administration Report", font));
        font = new Font(bf, 12);
        my_pdf_report.add(new Paragraph("Filter applied:" + conditions, font));
        my_pdf_report.add(new Paragraph(" "));

        table_cell = new PdfPCell(new Phrase("Customer"));
        my_report_table.addCell(table_cell);
        table_cell = new PdfPCell(new Phrase("Start Date"));
        my_report_table.addCell(table_cell);
        table_cell = new PdfPCell(new Phrase("End Date"));
        my_report_table.addCell(table_cell);
        table_cell = new PdfPCell(new Phrase("Room"));
        my_report_table.addCell(table_cell);
        table_cell = new PdfPCell(new Phrase("Amount"));
        my_report_table.addCell(table_cell);
        table_cell = new PdfPCell(new Phrase("Transactions"));
        my_report_table.addCell(table_cell);

        for (Booking item : bookings) {
            String customer_b = item.getCustomerId().getId() + " " + item.getCustomerId().getFirstName() + " "
                    + item.getCustomerId().getLastName();
            table_cell = new PdfPCell(new Phrase(customer_b));
            my_report_table.addCell(table_cell);

            String date_start_b = dateToStr(item.getStartDate());
            table_cell = new PdfPCell(new Phrase(date_start_b));
            my_report_table.addCell(table_cell);

            String date_end_b = dateToStr(item.getEndDate());
            table_cell = new PdfPCell(new Phrase(date_end_b));
            my_report_table.addCell(table_cell);

            String room_b = String.valueOf(item.getRoomId().getRoomNumber());
            table_cell = new PdfPCell(new Phrase(room_b));
            my_report_table.addCell(table_cell);

            String price_b = String.format("%1$,.2f", item.getTotalPrice());
            table_cell = new PdfPCell(new Phrase(price_b));
            my_report_table.addCell(table_cell);

            String transaction_b = "";
            for (PaymentTransaction trans : item.getPaymentTransactionList()) {
                transaction_b += String.format("%1$,.2f", trans.getAmount()) + " "
                        + trans.getPaymentTypeId().getDescription() + "\n";
            }
            table_cell = new PdfPCell(new Phrase(transaction_b));
            my_report_table.addCell(table_cell);
        }

        /* Attach report table to PDF */
        my_pdf_report.add(my_report_table);
        my_pdf_report.add(new Paragraph(" "));
        font = new Font(bf, 6);
        my_pdf_report.add(new Paragraph("Report Time:" + dateTimeToStr(new Date())));
        my_pdf_report.close();

    } catch (DocumentException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

}

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

/**
 * @param args/*from  w  w w .  j  a  v  a2s.c om*/
 * @throws Exception
 */
public static Document createPDFBudwork(String file, TbDescriptionstatement tbDescriptionstatement,
        List<TbAddmoneyvara> tbAddmoneyvaras, List<TbAddmoneynovara> tbAddmoneynovaras,
        List<TbRemunerationcommittee> tbRemunerationcommittees, List<TbMaketimeformeal> tbMaketimeformeals,
        List<TbRentshouse> tbRentshouses, List<TbTeachextra> tbTeachextras, List<TbExpenpaper> tbExpenpapers,
        List<TbComlecturer> tbComlecturers, List<TbOthercompensation> tbOthercompensations,
        List<TbAllowancesrental> tbAllowancesrentals, List<TbRepairofequipment> tbRepairofequipments,
        List<TbWageservice> tbWageservices, List<TbMeetingofthesnack> tbMeetingofthesnacks,
        List<TbSocialsecurity> tbSocialsecuritys, List<TbRentalproperty> tbRentalpropertys,
        List<TbThecertificationfood> tbThecertificationfoods,
        List<TbThecertificationdrink> tbThecertificationdrinks, List<TbThegift> tbThegifts, List<TbTax> tbTaxs,
        List<TbFee> tbFees, List<TbInsurance> tbInsurances, List<TbEmploy> tbEmploys,
        List<TbMaterial> tbMaterials1, List<TbMaterial> tbMaterials2, List<TbMaterial> tbMaterials3,
        List<TbMaterial> tbMaterials4, List<TbMaterial> tbMaterials5, List<TbMaterial> tbMaterials6,
        List<TbMaterial> tbMaterials7, List<TbMaterial> tbMaterials8, List<TbMaterial> tbMaterials9,
        List<TbMaterial> tbMaterials10, List<TbMaterial> tbMaterials11, List<TbPublicutility> tbPublicutilitys,
        List<TbGasolineDetail> tbGasolineDetails) throws Exception {

    Document document = null;

    try {
        Font font16 = new Font(
                BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED));
        font16.setSize(16);
        document = new Document();
        PdfWriter.getInstance(document, new FileOutputStream(file));
        document.open();
        Paragraph paragraph = new Paragraph();

        addMetaData(document);

        addTitlePageBud(document);

        createPagePDFBudwork(document, tbDescriptionstatement);

        createHeadlistBudwork(document, "1");

        PdfPTable table = createtableAddmoneyvara(tbAddmoneyvaras, tbDescriptionstatement.getSumAddmoneyvara());
        document.add(table);
        table.setSpacingBefore(25);

        table = createtableAddmoneynovara(tbAddmoneynovaras, tbDescriptionstatement.getSumAddmoneynovara());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableRemunerationcommittee(tbRemunerationcommittees,
                tbDescriptionstatement.getSumRemunerationcomnittee());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableMaketimeformeal(tbMaketimeformeals, tbDescriptionstatement.getSumMaketimeformeals());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableRentshouse(tbRentshouses, tbDescriptionstatement.getSumRentshouse());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableTeachextra(tbTeachextras, tbDescriptionstatement.getSumTeachextra());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableExpenpaper(tbExpenpapers, tbDescriptionstatement.getSumExpenpaper());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableComlecturer(tbComlecturers, tbDescriptionstatement.getSumComlecturer());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableOthercompensation(tbOthercompensations,
                tbDescriptionstatement.getSumOthercompensation());
        table.setSpacingBefore(25);
        document.add(table);

        createHeadlistBudwork(document, "2");

        table = createtableAllowancesrental(tbAllowancesrentals,
                tbDescriptionstatement.getSumAllowancesrental());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableGasolineDetail(tbGasolineDetails, tbDescriptionstatement.getSumGasoline());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableRepairofequipment(tbRepairofequipments,
                tbDescriptionstatement.getSumRepairofequipment());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableWageservice(tbWageservices, tbDescriptionstatement.getSumWageservice());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableMeetingofthesnack(tbMeetingofthesnacks,
                tbDescriptionstatement.getSumMeetingofthesnack());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableSocialsecurity(tbSocialsecuritys, tbDescriptionstatement.getSumSocialsecurity());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableRentalproperty(tbRentalpropertys, tbDescriptionstatement.getSumRentalproperty());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableThecertificationfood(tbThecertificationfoods,
                tbDescriptionstatement.getSumThecertificationfood());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableThecertificationdrinks(tbThecertificationdrinks,
                tbDescriptionstatement.getSumThecertificationdrink());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableThegift(tbThegifts, tbDescriptionstatement.getSumThegift());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableTax(tbTaxs, tbDescriptionstatement.getSumTax());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableFee(tbFees, tbDescriptionstatement.getSumFee());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableInsurance(tbInsurances, tbDescriptionstatement.getSumInsurance());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableEmploy(tbEmploys, tbDescriptionstatement.getSumEmploy());
        table.setSpacingBefore(25);
        document.add(table);

        createHeadlistBudwork(document, "3");

        table = createtableMaterial1(tbMaterials1, tbDescriptionstatement.getSumMOffice());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableMaterial2(tbMaterials2, tbDescriptionstatement.getSumMBuild());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableMaterial3(tbMaterials3, tbDescriptionstatement.getSumMKitchen());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableMaterial4(tbMaterials4, tbDescriptionstatement.getSumMElectrical());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableMaterial5(tbMaterials5, tbDescriptionstatement.getSumMMedic());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableMaterial6(tbMaterials6, tbDescriptionstatement.getSumMStudy());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableMaterial7(tbMaterials7, tbDescriptionstatement.getSumMBook());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableMaterial8(tbMaterials8, tbDescriptionstatement.getSumMFarm());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableMaterial9(tbMaterials9, tbDescriptionstatement.getSumMCom());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableMaterial10(tbMaterials10, tbDescriptionstatement.getSumMMul());
        table.setSpacingBefore(25);
        document.add(table);

        table = createtableMaterial11(tbMaterials11, tbDescriptionstatement.getSumMOther());
        table.setSpacingBefore(25);
        document.add(table);

        createHeadlistBudwork(document, "4");

        table = createtablePublicutility(tbPublicutilitys, tbDescriptionstatement.getSumPublicutility());
        table.setSpacingBefore(25);
        document.add(table);

        document.close();
    } catch (FileNotFoundException e) {

        e.printStackTrace();
    } catch (DocumentException e) {
        e.printStackTrace();
    }
    return document;
}

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

private static void addTitlePage(Document document) throws DocumentException, IOException {

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

    String imagepath = "src/main/webapp/resources/images/curt.gif";
    Image img = Image.getInstance(imagepath);
    img.scaleToFit(70f, 70f);

    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM/dd/yyyy");

    Paragraph created = new Paragraph();
    created.setFont(TIME_ROMAN_SMALL);
    created.add("Report created on " + simpleDateFormat.format(new Date()));
    created.setAlignment(Element.ALIGN_RIGHT);

    Paragraph logo = new Paragraph();
    logo.setFont(TIME_ROMAN_SMALL);
    logo.add(img);
    logo.setAlignment(Element.ALIGN_LEFT);
    document.add(created);
    document.add(logo);

    // Paragraph created = new Paragraph();
    // created.setFont(TIME_ROMAN_SMALL);
    // created.add("Report created on " + simpleDateFormat.format(new
    // Date()));
    // created.setAlignment(Element.ALIGN_RIGHT);

    Paragraph paragraph = new Paragraph();
    paragraph.setFont(font);
    paragraph.add("FormProject ");

    paragraph.setAlignment(Element.ALIGN_CENTER);
    document.add(paragraph);
    creteEmptyLine(created, 1);

}

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

private static void createTable(Document document) throws DocumentException, IOException {
    Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED));
    font.setSize(16);// w  w w  .j a v  a2s . c  o  m

    Paragraph paragraph = new Paragraph();
    paragraph.setFont(font);
    creteEmptyLine(paragraph, 2);
    document.add(paragraph);
    PdfPTable table = new PdfPTable(7);

    paragraph.add("");

    PdfPCell c1 = new PdfPCell(new Phrase("asasas", font));

    c1.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(c1);

    c1 = new PdfPCell(new Phrase("/?", font));
    c1.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(c1);

    c1 = new PdfPCell(new Phrase("?", font));
    c1.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(c1);

    TbActivity ac = new TbActivity();

    c1 = new PdfPCell(new Phrase("", font));
    c1.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(c1);

    c1 = new PdfPCell(new Phrase("", font));
    c1.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(c1);

    c1 = new PdfPCell(new Phrase("", font));
    c1.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(c1);

    c1 = new PdfPCell(new Phrase("", font));
    c1.setHorizontalAlignment(Element.ALIGN_CENTER);
    table.addCell(c1);
    table.setHeaderRows(1);

    paragraph.add("");

    for (int i = 0; i < 7; i++) {
        table.setWidthPercentage(100);
        table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
        table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
        table.addCell(paragraph);

    }

    document.add(table);
}

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

private static void createPagePDFFormProject(Document document, TbFormProject tbFormProject,
        List<TbActivity> activity, List<TbDetailSka> detailSka, List<TbDetailSm> detailSms,
        TbFormSubproject subProject) throws DocumentException, IOException {

    Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED));
    font.setSize(16);/*from   w w  w .  j av a2s.  co m*/
    int acNo = 0;

    Paragraph openning = new Paragraph();
    Paragraph ska = new Paragraph();
    Paragraph sms = new Paragraph();
    Paragraph notice = new Paragraph();
    Paragraph address = new Paragraph();
    Paragraph readyTodo = new Paragraph();

    readyTodo.setFont(font);
    address.setFont(font);
    ska.setFont(font);
    sms.setFont(font);
    notice.setFont(font);
    openning.setFont(font);
    openning.add("  : " + tbFormProject.getTbFaculty().getFacultyName());
    creteEmptyLine(openning, 1);
    openning.add("?"
            + tbFormProject.getTbStrBud().getStrBudName());
    creteEmptyLine(openning, 1);
    openning.add("?  : " + tbFormProject.getTbPlan().getPlansName());
    creteEmptyLine(openning, 1);
    openning.add("? : "
            + tbFormProject.getTbStrMin().getStrMinName());
    creteEmptyLine(openning, 1);
    openning.add("? : "
            + tbFormProject.getTbMisUni().getMisUniName());
    creteEmptyLine(openning, 1);
    openning.add(" : "
            + tbFormProject.getTbSubUni().getSubUniName());
    creteEmptyLine(openning, 1);
    openning.add("? : " + tbFormProject.getTbProduct().getProductName());
    creteEmptyLine(openning, 1);
    openning.add(
            "? : " + tbFormProject.getTbProjectname().getProjectnameName());
    creteEmptyLine(openning, 1);
    openning.add("? : "
            + tbFormProject.getTbPerson().getPersonName() + " "
            + tbFormProject.getTbPerson().getPersonLastname());
    creteEmptyLine(openning, 1);
    openning.add("  : " + tbFormProject.getTotal());
    creteEmptyLine(openning, 1);
    openning.add("? : "
            + tbFormProject.getAllocateMoney());
    creteEmptyLine(openning, 1);
    openning.add(" : "
            + (Long.parseLong(tbFormProject.getAllocateMoney())
                    - Long.parseLong(tbFormProject.getMoneyBalance())));
    creteEmptyLine(openning, 1);
    openning.add(" : " + tbFormProject.getMoneyBalance());

    creteLine(openning, 1);
    creteEmptyLine(openning, 1);
    for (TbActivity ac : activity) {
        acNo++;
        openning.add("??" + acNo + ":" + ac.getActivityName()
                + "?? : " + ac.getAddressName());
        creteEmptyLine(openning, 1);
        openning.add("?? : " + ac.getStartdate()
                + "?? : " + ac.getEnddate());
        creteEmptyLine(openning, 1);
        openning.add("? : "
                + ac.getAllocateMoney() + " : "
                + ac.getMoneyBalance());
        creteEmptyLine(openning, 1);
        openning.add(" : "
                + (Long.parseLong(ac.getAllocateMoney()) - Long.parseLong(ac.getMoneyBalance())));

        creteLine(openning, 1);
        creteEmptyLine(openning, 1);
    }
    ska.add("      ?? (?)");
    creteEmptyLine(ska, 1);
    for (TbDetailSka de : detailSka) {
        ska.add(de.getTbSkaType().getSkaTypeName() + "  : "
                + de.getTbSkaIndicatorsFac().getSkaIndicatorsFacName() + "  : "
                + de.getTbSkaIndicatorsHouse().getSkaIndicatorsHouseName());
        creteEmptyLine(ska, 1);
    }
    sms.add("      ??? ()");
    creteEmptyLine(sms, 1);
    for (TbDetailSm sm : detailSms) {
        sms.add(sm.getTbSmsCategory().getSmsCategoryName() + " " + "  "
                + sm.getTbSmsIndicator().getSmsIndicatorsName());
        creteEmptyLine(sms, 1);
    }

    notice.add(
            " : ???????  ?????? ");
    creteEmptyLine(notice, 1);

    address.add("? : " + " : "
            + subProject.getTbAmphur().getAmphurTh() + " : "
            + subProject.getTbProvince().getProvinceTh());
    creteEmptyLine(address, 1);

    readyTodo.add("?");
    creteEmptyLine(readyTodo, 1);
    readyTodo.add("? : "
            + subProject.getTbApproPlaceType().getApproPlaceTypeName());
    creteEmptyLine(readyTodo, 1);
    readyTodo.add("?/ : "
            + subProject.getTbApproPoint1().getApproPointName());
    creteEmptyLine(readyTodo, 1);
    readyTodo.add("/?  : "
            + subProject.getTbApproPoint2().getApproPointName());
    creteEmptyLine(readyTodo, 1);
    readyTodo.add("?? : "
            + subProject.getTbApproProjectType().getApproProjectTypeName());
    creteEmptyLine(readyTodo, 1);

    document.add(openning);
    document.add(ska);
    document.add(sms);
    document.add(notice);
    document.add(address);
    document.add(readyTodo);

}

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

public static PdfPTable createtableTargetGroup(TbTargetgroup targetGroup) throws DocumentException, Exception {

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

    PdfPTable table = new PdfPTable(3);
    table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
    table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
    PdfPCell cell = new PdfPCell(new Phrase("? ", 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);

    table.addCell(new PdfPCell(new Phrase("", font)));
    table.addCell(new PdfPCell(new Phrase(targetGroup.getJooutMana(), font)));
    table.addCell(new PdfPCell(new Phrase(targetGroup.getJoinMana(), font)));

    table.addCell(new PdfPCell(new Phrase("", font)));
    table.addCell(new PdfPCell(new Phrase(targetGroup.getJooutTeach(), font)));
    table.addCell(new PdfPCell(new Phrase(targetGroup.getJoinTeach(), font)));

    table.addCell(new PdfPCell(new Phrase("", font)));
    table.addCell(new PdfPCell(new Phrase(targetGroup.getJooutEmp(), font)));
    table.addCell(new PdfPCell(new Phrase(targetGroup.getJoinEmp(), font)));

    table.addCell(new PdfPCell(new Phrase("??", font)));
    table.addCell(new PdfPCell(new Phrase(targetGroup.getJooutStu(), font)));
    table.addCell(new PdfPCell(new Phrase(targetGroup.getJoinStu(), font)));

    table.addCell(new PdfPCell(new Phrase("/?", font)));
    table.addCell(new PdfPCell(new Phrase(targetGroup.getJooutCommu(), font)));
    table.addCell(new PdfPCell(new Phrase(targetGroup.getJoinCommu(), font)));

    table.addCell(
            new PdfPCell(new Phrase("?/?", font)));
    table.addCell(new PdfPCell(new Phrase(targetGroup.getJooutDisable(), font)));
    table.addCell(new PdfPCell(new Phrase(targetGroup.getJoinDisable(), font)));

    table.addCell(new PdfPCell(new Phrase("", font)));
    table.addCell(new PdfPCell(new Phrase(targetGroup.getJooutOther(), font)));
    table.addCell(new PdfPCell(new Phrase(targetGroup.getJoinOther(), font)));

    return table;
}

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

public static PdfPTable createtableTargetGroup2(TbTargetgroup targetGroup) throws DocumentException, Exception {

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

    PdfPTable table = new PdfPTable(3);
    table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
    table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
    PdfPCell cell = new PdfPCell(new Phrase("?", 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);

    table.addCell(new PdfPCell(new Phrase("", font)));
    table.addCell(new PdfPCell(new Phrase(targetGroup.getActoutMana(), font)));
    table.addCell(new PdfPCell(new Phrase(targetGroup.getActinMana(), font)));

    table.addCell(new PdfPCell(new Phrase("", font)));
    table.addCell(new PdfPCell(new Phrase(targetGroup.getActoutTeach(), font)));
    table.addCell(new PdfPCell(new Phrase(targetGroup.getActinTeach(), font)));

    table.addCell(new PdfPCell(new Phrase("", font)));
    table.addCell(new PdfPCell(new Phrase(targetGroup.getActoutEmp(), font)));
    table.addCell(new PdfPCell(new Phrase(targetGroup.getActinEmp(), font)));

    table.addCell(new PdfPCell(new Phrase("??", font)));
    table.addCell(new PdfPCell(new Phrase(targetGroup.getActoutStu(), font)));
    table.addCell(new PdfPCell(new Phrase(targetGroup.getJoinStu(), font)));

    table.addCell(new PdfPCell(new Phrase("?", font)));
    table.addCell(new PdfPCell(new Phrase(targetGroup.getActoutLect(), font)));
    table.addCell(new PdfPCell(new Phrase(targetGroup.getActinLect(), font)));

    return table;

}

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

private static void createPagePDFFormProject2(Document document, TbFormProject tbFormProject,
        List<TbActivity> activity, List<TbDetailSka> detailSka, List<TbDetailSm> detailSms,
        TbFormSubproject subProject) throws DocumentException, IOException {

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

    Paragraph openning = new Paragraph();
    openning.setFont(font);

    creteLine(openning, 1);
    openning.add("??? ");
    creteEmptyLine(openning, 1);
    openning.add("????");
    creteEmptyLine(openning, 1);
    openning.add("???  : "
            + subProject.getTbMonth1().getMonthLong());
    creteEmptyLine(openning, 1);
    openning.add(
            "? : " + subProject.getTbMonth2().getMonthLong());
    creteEmptyLine(openning, 1);
    openning.add(
            "??????? : "
                    + subProject.getTbMonth3().getMonthLong());
    creteEmptyLine(openning, 1);
    openning.add("??");
    creteEmptyLine(openning, 1);
    openning.add(
            "? ????  : "
                    + subProject.getTbMonth4().getMonthLong());
    creteEmptyLine(openning, 1);
    openning.add(
            "???   : "
                    + subProject.getTbMonth5().getMonthLong());
    creteEmptyLine(openning, 1);
    openning.add(
            "//?????   : "
                    + subProject.getTbMonth6().getMonthLong());
    creteEmptyLine(openning, 1);
    openning.add(
            "??? : ( 3 ?)    : "
                    + subProject.getWorkflowPlanBudget());
    creteLine(openning, 1);
    creteEmptyLine(openning, 1);
    document.add(openning);
}

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

public static PdfPTable createtableFollowCheck(TbFormSubproject subProject)
        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  a2s  .c  o  m*/

    PdfPTable table = new PdfPTable(3);
    table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
    table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
    PdfPCell cell = new PdfPCell(new Phrase(
            "?? (C_Check)",
            font));
    cell.setColspan(3);
    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);

    table.addCell(new PdfPCell(new Phrase(
            "????",
            font)));
    table.addCell(new PdfPCell(new Phrase(subProject.getFollowCCheckTool(), font)));
    table.addCell(new PdfPCell(new Phrase(subProject.getFollowCCheckTime(), font)));

    table.addCell(new PdfPCell(new Phrase(
            "??",
            font)));
    table.addCell(new PdfPCell(new Phrase(subProject.getAssesCCheckTool(), font)));
    table.addCell(new PdfPCell(new Phrase(subProject.getAssesCCheckTime(), font)));

    table.addCell(new PdfPCell(new Phrase(
            "?? /",
            font)));
    table.addCell(new PdfPCell(new Phrase(subProject.getFollowInCCheckTool(), font)));
    table.addCell(new PdfPCell(new Phrase(subProject.getFollowInCCheckTime(), font)));

    return table;

}