<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@page import="com.csc.library.report.ReportUDF" %>
<%@page import="java.io.OutputStream" %>
<%@page import="java.io.ByteArrayOutputStream" %>
<%@page import="java.util.GregorianCalendar" %>
<%@page import="com.csc.library.session.InitialInquiry" %>
<%@page import="com.csc.library.session.DbInquiry" %>
<%@page import="com.csc.library.entry.HelpEntry" %>
<%@page import="com.itextpdf.text.*" %>
<%@page import="com.itextpdf.text.pdf.*" %>
<%@page import="java.io.ByteArrayOutputStream" %>
<%@page import="com.csc.library.utilities.*" %>
<%@ page import="com.csc.library.databean.Simmdropresumewithgson" %>
<%@ page import="com.csc.library.database.MyHashMap" %>
<%@ page import="com.csc.library.utilities.gsonmapping.*" %>
<jsp:useBean id="DropResumePrint" class="com.csc.library.system.Task" scope="page"/>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8"/>
    <title>Report</title>
</head>
<body>
Not found data
<%
    DropResumePrint.setChannel(request, response);
    HelpEntry screen = (HelpEntry) DropResumePrint.process("HelpEntry", "MDROP_RESUMEHELP");
    CheckNull chk = new CheckNull();

    String filter = "EMAIL = '" + chk.chkNullString(request.getParameter("email")) + "'";
//    filter = "1=2";

    screen.setMaxLine(1);
    screen.inq.setFilter(filter);
    screen.process();

    ByteArrayOutputStream baos = new ByteArrayOutputStream();//72
    Document document = new Document(PageSize.A4, 50, 50, 30, 36);
    float[] sizeColumn = new float[]{};

    PdfWriter.getInstance(document, baos);
    document.open();
    document.addTitle("Document Title");


    BaseFont bfWithFontAWesome = BaseFont.createFont(application.getRealPath("FONTS/FontAwesome.otf"), BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
    BaseFont bf = BaseFont.createFont(application.getRealPath("FONTS/Cordia.ttf"), BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
    BaseFont bfHead = BaseFont.createFont(application.getRealPath("FONTS/Cordia.ttf"), BaseFont.IDENTITY_H, BaseFont.EMBEDDED, true);
    Font font = new Font(bf, 11);
    Font fontTopic = new Font(bfHead, 20, Font.BOLD);
    Font fontHead = new Font(bfHead, 13, Font.BOLD);
    Font fontHeadWhiteColor = new Font(bfHead, 11, Font.BOLD, new BaseColor(255, 255, 255));
    //fontHead.setStyle(Font.BOLD);
    Font fontContent = new Font(bfHead, 11);
    Font fontBoldContent = new Font(bfHead, 11, Font.BOLD);
    Font fontTitle = new Font(bfHead, 20, Font.BOLD);
    fontTitle.setStyle(Font.BOLD);
    Font fontAwesome = new Font(bfWithFontAWesome, 10);

    // set vlign middle
    Phrase content = new Phrase("Blah blah blah", font);
    Float fontSize = content.getFont().getSize();
    Float capHeight = content.getFont().getBaseFont().getFontDescriptor(BaseFont.CAPHEIGHT, fontSize);

    boolean hasData = false;
    if (screen.getInquiry().recCount() > 0) {
        hasData = true;
        screen.nextRec();
        screen.referLangOn();
        DbInquiry dbinq = null;
        int i = 0;

        Simmdropresumewithgson simmapplicantwithgson = (Simmdropresumewithgson) screen.inq.getCurrentDbRecord();
        //----------------------------mprefix------------------------------------

        String prefixTdesc = "";
        String prefixEdesc = "";

        DbInquiry inqmprefix = new InitialInquiry(screen.getUProfile()).getDbInquiry("mprefix");
        inqmprefix.setFilter("prefixid = '" + simmapplicantwithgson.mdrop_resumePersonal.prefixid + "'");
        inqmprefix.refresh();
        while (inqmprefix.next()) {
            prefixTdesc = inqmprefix.getString("tdesc");
            prefixEdesc = inqmprefix.getString("edesc");
        }

        //----------------------------END mprefix------------------------------------
        //----------------------------SET DATA Family------------------------------------
        MyHashMap familybackground = new MyHashMap();
        String[] masterrelations = {"01", "02", "03" ,"99"};
        String occupationDesc = "";
        String prefixTdesc_family = "";
        String line = "";
        int childtotal = 0;
        int relativetotal = 0;
        for (String relatationkey : masterrelations) {
            familybackground.put("prefix" + relatationkey, "");
            familybackground.put("fname" + relatationkey, "");
            familybackground.put("lname" + relatationkey, "");
            familybackground.put("age" + relatationkey, "");
            familybackground.put("occupation" + relatationkey, "");
            familybackground.put("position" + relatationkey, "");
            familybackground.put("status" + relatationkey, "");
            familybackground.put("workplace" + relatationkey, "");
            familybackground.put("phone" + relatationkey, "");
        }
        familybackground.putToSum("prefixallchild", "");
        familybackground.putToSum("nameallchild", "");
        familybackground.putToSum("ageallchild", "");
        familybackground.putToSum("occupationallchild", "");
        familybackground.putToSum("positionallchild", "");
        familybackground.putToSum("statusallchild", "");
        familybackground.putToSum("workplaceandphoneallchild", "");

        familybackground.putToSum("nameallrelative", "");
        familybackground.putToSum("ageallrelative", "");
        familybackground.putToSum("occupationallchild", "");
        familybackground.putToSum("positionallchild", "");
        familybackground.putToSum("statusallrelative", "");
        familybackground.putToSum("workplaceandphoneallrelative", "");


        DbInquiry inqoccupation = new InitialInquiry(screen.getUProfile()).getDbInquiry("moccupation");
        DbInquiry inqmprefix_family = new InitialInquiry(screen.getUProfile()).getDbInquiry("mprefix");

        String prefixallchild = "";
        String nameallchild = "";
        String ageallchild = "";
        String occupationallchild = "";
        String positionallchild = "";
        String statusallchild = "";
        String workplaceandphoneallchild = "";

        String nameallrelative = "";
        String ageallrelative = "";
        String occupationallrelative = "";
        String positionallrelative = "";
        String statusallrelative = "";
        String workplaceandphoneallrelative = "";

        for (Mdrop_resumeFamily.Family family : simmapplicantwithgson.mdrop_resumeFamily.family) {
            inqoccupation.setFilter("occid = '" + family.occupation+ "'");
            inqoccupation.refresh();
            inqmprefix_family.setFilter("prefixid = '" + family.prefixid + "'");
            inqmprefix_family.refresh();
            while (inqoccupation.next()) {
                occupationDesc = inqoccupation.getString("tdesc");
            }
            while (inqmprefix_family.next()) {
                prefixTdesc_family = inqmprefix_family.getString("tdesc");
            }
            familybackground.put("prefix" + family.relation,prefixTdesc_family);
            familybackground.put("fname" + family.relation, family.fname);
            familybackground.put("lname" + family.relation, family.lname);
            familybackground.put("age" + family.relation, family.age);
            familybackground.put("occupation" + family.relation, occupationDesc);
            familybackground.put("position" + family.relation, family.position);
            familybackground.put("status" + family.relation, family.status);
            familybackground.put("workplace" + family.relation, family.workplace);
            familybackground.put("phone" + family.relation, family.phone);


            if ("09,10,11,12,".indexOf(family.relation) > -1) {
                if (childtotal > 0) {
                    line = System.lineSeparator();
                }
                prefixallchild += line + prefixTdesc_family;
                nameallchild += line + family.fname + " " + family.lname;
                ageallchild += line + family.age;
                occupationallchild += line + occupationDesc;
                positionallchild += line + family.position;
                statusallchild += line + family.status;
                workplaceandphoneallchild += line + family.workplace + " " + family.phone;
                childtotal++;
            }
            if ("05,06,07,08,".indexOf(family.relation) > -1) {
                if (relativetotal > 0) {
                    line = System.lineSeparator();
                }
                nameallrelative += line + prefixTdesc_family+" "+family.fname + " " + family.lname;
                ageallrelative += line + family.age;
                occupationallrelative += line + occupationDesc;
                positionallrelative += line + family.position;
                statusallrelative += line + family.status;
                workplaceandphoneallrelative += line + family.workplace + " " + family.phone;
                relativetotal++;
            }
        }
        familybackground.putToSum("prefixallchild",prefixallchild);
        familybackground.putToSum("nameallchild", nameallchild);
        familybackground.putToSum("ageallchild", ageallchild);
        familybackground.putToSum("occupationallchild", occupationallchild);
        familybackground.putToSum("positionallchild", positionallchild);
        familybackground.putToSum("statusallchild", line + statusallchild);
        familybackground.putToSum("workplaceandphoneallchild", workplaceandphoneallchild);

        familybackground.putToSum("nameallrelative", nameallrelative);
        familybackground.putToSum("ageallrelative", ageallrelative);
        familybackground.putToSum("occupationallrelative", occupationallrelative);
        familybackground.putToSum("positionallrelative", positionallrelative);
        familybackground.putToSum("statusallrelative", statusallrelative);
        familybackground.putToSum("workplaceandphoneallrelative", workplaceandphoneallrelative);
        //----------------------------END Family------------------------------------
        //----------------------------SETDATA OTHER ------------------------------------
        String nameregroup = "";
        String lnameregroup = "";
        String positionregroup = "";
        for (Mdrop_resumeOther.RefereeGroup refereeGroup : simmapplicantwithgson.mdrop_resumeOther.refereeGroup) {
            nameregroup = refereeGroup.name;
            lnameregroup = refereeGroup.lname;
            positionregroup = refereeGroup.position;
        }

        //----------------------------END OTHER-----------------------------------------
        //----------------------------SETDATA EDUCATION------------------------------------
        MyHashMap educationbackground = new MyHashMap();
        String[] masterdegree = {"001", "006", "007", "004", "005"};
        String degreeDesc = "";

        for (String degreekey : masterdegree) {

            educationbackground.put("name" + degreekey, "");
            educationbackground.put("from" + degreekey, "");
            educationbackground.put("to" + degreekey, "");
            educationbackground.put("degree" + degreekey, "");
            educationbackground.put("major" + degreekey, "");
            educationbackground.put("gpa" + degreekey, "");
        }
        DbInquiry inqdegree = new InitialInquiry(screen.getUProfile()).getDbInquiry("mdegree");
        for (Mdrop_resumeEducation.Education education : simmapplicantwithgson.mdrop_resumeEducation.education) {
            inqdegree.setFilter("degreeid = '" + education.degreetype + "'");
            inqdegree.refresh();
            while (inqdegree.next()) {
                degreeDesc = inqdegree.getString("tdesc");
            }

            if (education.university.universitylist == null) {
                educationbackground.put("name" + education.degreetype, education.university.searchtext);
            } else {
                educationbackground.put("name" + education.degreetype, education.university.universitylist.name.tha);
            }
            educationbackground.put("from" + education.degreetype, education.yearstart);
            educationbackground.put("to" + education.degreetype, education.yearend);
            educationbackground.put("degree" + education.degreetype, degreeDesc);
            if (education.major.majorlist == null) {
                educationbackground.put("major" + education.degreetype, "");
            } else {
                educationbackground.put("major" + education.degreetype, education.major.majorlist.name.tha);
            }
            educationbackground.put("gpa" + education.degreetype, education.gpa);
        }

        //----------------------------SETDATA CONTACT ------------------------------------
        StringBuilder sb = new StringBuilder();
        sb.append(simmapplicantwithgson.mdrop_resumeContact.home.addr);
        if (!simmapplicantwithgson.mdrop_resumeContact.home.moo.equalsIgnoreCase("-")) {
            sb.append(" หมู่ " + simmapplicantwithgson.mdrop_resumeContact.home.moo);
        }
        sb.append(" ต. " + simmapplicantwithgson.mdrop_resumeContact.home.district);
        sb.append(" อ. " + simmapplicantwithgson.mdrop_resumeContact.home.zipcode.disname.tha);
        sb.append(" จ. " + simmapplicantwithgson.mdrop_resumeContact.home.zipcode.proname.tha);
        sb.append("    " + simmapplicantwithgson.mdrop_resumeContact.home.zipcode.zipid);

        StringBuilder sc = new StringBuilder();
        sc.append(simmapplicantwithgson.mdrop_resumeContact.current.addr);
        if (!simmapplicantwithgson.mdrop_resumeContact.home.moo.equalsIgnoreCase("-")) {
            sc.append(" หมู่ " + simmapplicantwithgson.mdrop_resumeContact.home.moo);
        }
        sc.append(" ถนน " + simmapplicantwithgson.mdrop_resumeContact.home.road);
        sc.append(" ต. " + simmapplicantwithgson.mdrop_resumeContact.home.district);
        sc.append(" อ. " + simmapplicantwithgson.mdrop_resumeContact.home.zipcode.disname.tha);
        sc.append(" จ. " + simmapplicantwithgson.mdrop_resumeContact.home.zipcode.proname.tha);
        sc.append("    " + simmapplicantwithgson.mdrop_resumeContact.home.zipcode.zipid);
        //----------------------------END CONTACT------------------------------------

        //----------------------------SETDATA JOPEXP------------------------------------
        MyHashMap jobexp = new MyHashMap();
        int roundjobexp = 0;

        for (int jobexpkey = 0; jobexpkey <= 10; jobexpkey++){
            jobexp.put("companyname_job" + jobexpkey, "");
            jobexp.put("start" + jobexpkey, "");
            jobexp.put("end" + jobexpkey, "");
            jobexp.put("title" + jobexpkey, "");
            jobexp.put("description" + jobexpkey, "");
            jobexp.put("salary" + jobexpkey, "");
            jobexp.put("reason" + jobexpkey, "");
            jobexp.put("addr" + jobexpkey, "");
            jobexp.put("village" + jobexpkey, "");
            jobexp.put("floor" + jobexpkey, "");
            jobexp.put("soi" + jobexpkey, "");
            jobexp.put("moo" + jobexpkey, "");
            jobexp.put("road" + jobexpkey, "");
            jobexp.put("district" + jobexpkey, "");
            jobexp.put("disname" + jobexpkey, "");
            jobexp.put("proname" + jobexpkey, "");
            jobexp.put("zipid" + jobexpkey, "");
            jobexp.put("phoneJob" + jobexpkey, "");
        }
        for (Mdrop_resumeJobexp.Job job : simmapplicantwithgson.mdrop_resumeJobexp.job) {
            jobexp.put("companyname_job" + roundjobexp, job.companyname);
            jobexp.put("start" + roundjobexp,new CscCalendar(job.start.toString().substring(0,10)).getDDMMYYYY());
            jobexp.put("end" + roundjobexp, new CscCalendar(job.end.toString().substring(0,10)).getDDMMYYYY());
            jobexp.put("title" + roundjobexp, job.title);
            jobexp.put("description" + roundjobexp, job.description);
            jobexp.put("salary" + roundjobexp, job.salary);
            jobexp.put("reason" + roundjobexp, job.reason);
            jobexp.put("addr" + roundjobexp, job.addr);
            jobexp.put("village" + roundjobexp, job.village);
            jobexp.put("floor" + roundjobexp, job.floor);
            jobexp.put("soi" + roundjobexp, job.soi);
            jobexp.put("moo" + roundjobexp, job.moo);
            jobexp.put("road" + roundjobexp, job.road);
            jobexp.put("district" + roundjobexp, job.district);
            jobexp.put("disname_job" + roundjobexp, job.zipcode.disname.tha);
            jobexp.put("proname_job" + roundjobexp, job.zipcode.proname.tha);
            jobexp.put("zipid" + roundjobexp, job.zipcode.zipid);
            jobexp.put("phoneJob" + roundjobexp, job.phone);
            roundjobexp++;
        }
        //----------------------------END JOPEXP------------------------------------

        //----------------------------nationality------------------------------------

        String nationalityDesc = "";

        DbInquiry inqMnationality = new InitialInquiry(screen.getUProfile()).getDbInquiry("Mnationality");
        inqMnationality.setFilter("nationalityid = '" + simmapplicantwithgson.mdrop_resumePersonal.nationalityid + "'");
        inqMnationality.refresh();
        while (inqMnationality.next()) {
            nationalityDesc = inqMnationality.getString("tdesc");
        }

        //----------------------------END nationality------------------------------------

        //------------------------------------age------------------------------------
        String age_memployee = "";

        CscCalendar startDate = new CscCalendar(simmapplicantwithgson.mdrop_resumePersonal.birthdate.substring(0,10));
        CscCalendar endDate = new CscCalendar();
        CountAge count = new CountAge(screen.getUProfile().get("lang"));
        age_memployee=count.getCountAges(startDate,endDate,true);

        //------------------------------------end age------------------------------------

        //----------------------------nationa------------------------------------

        String nationaDesc = "";

        DbInquiry inqmnational = new InitialInquiry(screen.getUProfile()).getDbInquiry("mnational");
        inqmnational.setFilter("nationalid = '" + simmapplicantwithgson.mdrop_resumePersonal.nationalityid + "'");
        inqmnational.refresh();
        while (inqmnational.next()) {
            nationaDesc = inqmnational.getString("tdesc");
        }

        //----------------------------END nationa------------------------------------

        // ----------------------------religion------------------------------------

        String religionDesc = "";

        DbInquiry inqmreligion = new InitialInquiry(screen.getUProfile()).getDbInquiry("mreligion");
        inqmreligion.setFilter("religionid = '"+simmapplicantwithgson.mdrop_resumePersonal.religionid+"'");
        inqmreligion.refresh();
        while(inqmreligion.next()){
            religionDesc = inqmreligion.getString("tdesc");
        }

        //----------------------------END religion------------------------------------
        //----------------------------SETDATA Skill ------------------------------------
        MyHashMap hmlangskill = new MyHashMap();
        MyHashMap masterskilllevel = new MyHashMap();
        String skillnameDesc ="";
        String skilllevelDesc ="";
        int langskillloop = 0;

        for(int initlangskill = 0; initlangskill <= 5; initlangskill++){
            hmlangskill.put("skillname"+initlangskill,"");
            hmlangskill.put("reading"+initlangskill,"");
            hmlangskill.put("write"+initlangskill,"");
            hmlangskill.put("speak"+initlangskill,"");
            hmlangskill.put("listen"+initlangskill,"");
        }

        DbInquiry inqskilllevel = new InitialInquiry(screen.getUProfile()).getDbInquiry("mskilllevel");
        inqskilllevel.refresh();
        while(inqskilllevel.next()) {
            masterskilllevel.put(inqskilllevel.getString("skilllevelid"),inqskilllevel.getString("tdesc"));
        }
        DbInquiry inqlangskill = new InitialInquiry(screen.getUProfile()).getDbInquiry("mlanguage");
        for (Mdrop_resumeSkill.Langskill langskill : simmapplicantwithgson.mdrop_resumeSkill.langskill) {
            inqlangskill.setFilter("languageid = '"+langskill.name+"'");
            inqlangskill.refresh();
            while(inqlangskill.next()) {
                skillnameDesc = inqlangskill.getString("tdesc");
            }
            hmlangskill.put("skillname"+langskillloop,skillnameDesc);
            hmlangskill.put("reading"+langskillloop,masterskilllevel.get(langskill.skill.reading));
            hmlangskill.put("write"+langskillloop,masterskilllevel.get(langskill.skill.write));
            hmlangskill.put("speak"+langskillloop,masterskilllevel.get(langskill.skill.speak));
            hmlangskill.put("listen"+langskillloop,masterskilllevel.get(langskill.skill.listen));
            langskillloop++;

        }
        //----------------------------End Skill ----------------------------------------
        try {
            CscCalendar calendar = new CscCalendar();
            GregorianCalendar gc = new GregorianCalendar();
            boolean langthai = screen.getUProfile().get("lang").equalsIgnoreCase("THA");
            String reportname = "", printdate = "", printby = "", refer = "RTA2007";
            String reportname_label = "", printdate_label = "", prdate = "", refer_label = "";
            if (langthai) {
                reportname_label = "รายงาน :";
                reportname = "รายงานข้อมูลพนักงาน";
                printdate_label = "วันที่พิมพ์ :";
                prdate = calendar.getDDMMYYYY();
                printdate = "วัน" + calendar.getLongThiDOW() + "ที่ " + calendar.getDate() + " " + calendar.getThaiLongMonth() + " พ.ศ. " + calendar.getThaiYYYY() + " " + calendar.getHHMM() + " น.";
                printby = screen.getUProfile().get("tfullname");
                refer_label = "อ้างอิง #";
            } else {
                reportname_label = "Report Name :";
                reportname = "Personal Report";
                printdate_label = "Print Date :";
                printby = screen.getUProfile().get("efullname");
                refer_label = "Ref #";
            }


            //--------------- Report Header Logo-----------------
//      sizeColumn = new float[] {50.0f,50.0f};
//      PdfPTable detail = new PdfPTable(2);
//      detail.setWidthPercentage(100);
//      detail.setWidths(sizeColumn);
//      PdfPCell cellDetail;
//      Image img = null;
//      setPaddingTop(0.5f);
//      setPaddingLeft(0.0f);
//      setPaddingRight(0.0f);
//      detail.addCell( getCellData("Lesson Plan", fontTitle, true, "LEFT", "MIDDLE", 1, 0) );
//
//      String defaultFile = "default.png";
//      String filename = screen.getString("MCOMPANY","logo");
//      InitialEnvironment inv = new InitialEnvironment("GLOBAL");
//      String path = inv.getValue("COMPANY_UPLOAD-dir")+"LOGO/";
//      if (!new File(path+filename).exists() || filename.equals("")){
//        filename = defaultFile;
//      }
//
//      img = Image.getInstance(path+filename);
//      cellDetail = new PdfPCell(img, true);
//      cellDetail.setHorizontalAlignment(Element.ALIGN_RIGHT);
//      cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
//      cellDetail.setFixedHeight(40);
//      cellDetail.setBorder(Rectangle.NO_BORDER);
//      detail.addCell(cellDetail);
            // --------------- Report Header -----------------
            // --------------- new line -----------------
            sizeColumn = new float[]{30.0f, 25.0f, 06.0f};
            PdfPTable detail = new PdfPTable(3);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            PdfPCell cellDetail;
            Image img = null;
            setPaddingTop(0.5f);
            setPaddingLeft(0.0f);
            setPaddingRight(0.0f);

            cellDetail = new PdfPCell(new Phrase("DCC/Form:HRD/Issue No.3", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.NO_BORDER);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("", fontAwesome));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.NO_BORDER);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("HRD-FM034", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.NO_BORDER);
            detail.addCell(cellDetail);
            document.add(detail);

            // --------------- new line -----------------
            sizeColumn = new float[]{95.0f, 5.0f};
            detail = new PdfPTable(2);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);

            cellDetail = new PdfPCell(new Phrase(" ", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.NO_BORDER);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("p.1/2", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.NO_BORDER);
            detail.addCell(cellDetail);

            document.add(detail);

            // --------------- new line -----------------
            sizeColumn = new float[]{100.0f};
            detail = new PdfPTable(1);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(0.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);

            detail.addCell(getCellData("บริษัท อำพลฟูดส์ โพรเซลซิ่ง จำกัด", fontTitle, true, "CENTER", "BOTTOM", 0, 0));
            document.add(detail);

            // --------------- new line -----------------
            sizeColumn = new float[]{44.0f, 35.0f, 21.0f};
            detail = new PdfPTable(3);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);

            cellDetail = new PdfPCell(new Phrase("ใบสมัครงาน Application Form", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP | Rectangle.LEFT);

            cellDetail.setColspan(2);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("รูปถ่าย\nPhoto", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(80);
            cellDetail.setRowspan(3);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("ตำแหน่งงานที่สมัคร 1)   " + (screen.getString("MJOBCODE", "TDESC")), fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.LEFT);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("2)", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.NO_BORDER);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("วันที่สามารถเริ่มงานได้ :   " + new CscCalendar(simmapplicantwithgson.mdrop_resumePersonal.dateavailable.substring(0, 10)).getThaiFullDDMMYYYY(), fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.LEFT);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("โทรศัพท์มือถือ   :  " + simmapplicantwithgson.mdrop_resumeContact.current.number, fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.NO_BORDER);
            detail.addCell(cellDetail);

            document.add(detail);

            // --------------- new line -----------------
            sizeColumn = new float[]{79.0f, 7.0f, 7.0f, 7.0f};
            detail = new PdfPTable(4);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);
            setBaseBackgroundColor(60, 175, 74);
            detail.addCell(getCellData("ประวัติส่วนตัว Personal Information", fontHead, false, "CENTER", "BOTTOM", 1, 0, true));
            detail.addCell(getCellData("อายุ\n" +age_memployee.substring(0,2), fontHead, false, "CENTER", "MIDDLE", 1, 2, false));
            detail.addCell(getCellData("ส่วนสูง\n" + simmapplicantwithgson.mdrop_resumePersonal.height, fontHead, false, "CENTER", "MIDDLE", 1, 2, false));
            detail.addCell(getCellData("น้ำหนัก\n" + simmapplicantwithgson.mdrop_resumePersonal.weight, fontHead, false, "CENTER", "MIDDLE", 1, 2, false));
            detail.addCell(getCellData("ชื่อ/สกุล(ภาษาไทย)  : " +prefixTdesc+" "+ simmapplicantwithgson.mdrop_resumePersonal.fname.tha + "   " + simmapplicantwithgson.mdrop_resumePersonal.lname.tha, fontHead, false, "LEFT", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData("First Name / Last Name (English)  : " +prefixEdesc+" "+ simmapplicantwithgson.mdrop_resumePersonal.fname.eng + "   " + simmapplicantwithgson.mdrop_resumePersonal.lname.eng, fontHead, false, "LEFT", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData("ชื่อเล่น  :  " + simmapplicantwithgson.mdrop_resumePersonal.nickname.tha, fontHead, false, "LEFT", "MIDDLE", 4, 1, false));
            document.add(detail);
            // --------------- new line -----------------
            sizeColumn = new float[]{100.0f};
            detail = new PdfPTable(1);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);
            setBaseBackgroundColor(60, 175, 74);
            detail.addCell(getCellData("ที่อยู่ปัจจุบัน \nPresent Address   " + sc.toString(), fontHead, false, "LEFT", "MIDDLE", 1, 0, false));

            document.add(detail);
            // --------------- new line -----------------
            sizeColumn = new float[]{70.0f, 30.0f};
            detail = new PdfPTable(2);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);
            setBaseBackgroundColor(60, 175, 74);
            detail.addCell(getCellData("ที่อยู่ตามทะเบียนบ้าน\nRegistered Address   " + sb.toString(), fontHead, false, "LEFT", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData("สถานที่เกิด (ระบุจังหวัด)\nPlace of Birth  :  " + simmapplicantwithgson.mdrop_resumeContact.home.zipcode.proname.tha, fontHead, false, "LEFT", "MIDDLE", 1, 0, false));
            document.add(detail);
            // --------------- new line -----------------
            sizeColumn = new float[]{44.0f, 35.0f};
            detail = new PdfPTable(2);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);

            cellDetail = new PdfPCell(new Phrase("โทรศัพท์\nTel.     " + simmapplicantwithgson.mdrop_resumeContact.current.number, fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(35);
            cellDetail.setBorder(Rectangle.LEFT);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("อีเมล์\nE-mail   :  " + (screen.getString("MDROP_RESUME", "EMAIL")), fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.RIGHT);
            detail.addCell(cellDetail);

            document.add(detail);
            // --------------- new line -----------------
            sizeColumn = new float[]{25.0f, 10.0f, 18.0f, 15.0f, 15.0f};
            detail = new PdfPTable(5);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);

            cellDetail = new PdfPCell(new Phrase("วัน/เดือน/ปี เกิด\nDate of Birth  :  " + new CscCalendar(simmapplicantwithgson.mdrop_resumePersonal.birthdate.substring(0, 10)).getThaiFullDDMMYYYY(), fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(35);
            cellDetail.setBorder(Rectangle.LEFT | Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("เพศ\nSex   :  " + new ReportUDF().getSystemCode("SEXJC", "tha", simmapplicantwithgson.mdrop_resumePersonal.genderid.toString()), fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP);
            detail.addCell(cellDetail);
            cellDetail = new PdfPCell(new Phrase("เชื้อชาติ\nNationality   :  " + nationaDesc, fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(35);
            cellDetail.setBorder(Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("สัญชาติ\nRace   :  " + nationalityDesc, fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP);
            detail.addCell(cellDetail);
            cellDetail = new PdfPCell(new Phrase("ศาสนา\nReligion   :  " + religionDesc, fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(35);
            cellDetail.setBorder(Rectangle.TOP | Rectangle.RIGHT);
            detail.addCell(cellDetail);
            document.add(detail);


            // --------------- new line -----------------
            sizeColumn = new float[]{30.0f, 40.0f, 20.0f};
            detail = new PdfPTable(3);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);

            cellDetail = new PdfPCell(new Phrase("เลขบัตรประจำตัวประชาชน ID Card\nNo.   :  " + simmapplicantwithgson.mdrop_resumePersonal.identification.idenNumber, fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(35);
            cellDetail.setBorder(Rectangle.LEFT | Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("วันหมดอายุ\nExpire Date   :  " + new CscCalendar(simmapplicantwithgson.mdrop_resumePersonal.identification.pinend.substring(0, 10)).getDDMMYYYY(), fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("ออกให้ ณ เขต/อำเภอ\nIssued at   :  " + simmapplicantwithgson.mdrop_resumePersonal.identification.issueAmp, fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(35);
            cellDetail.setBorder(Rectangle.TOP | Rectangle.RIGHT);
            detail.addCell(cellDetail);
            document.add(detail);

            // --------------- new line -----------------
            String personal_status = simmapplicantwithgson.mdrop_resumePersonal.status;
            sizeColumn = new float[]{10.0f, 1.5f, 5.0f, 1.5f, 5.0f, 1.5f, 10.0f, 1.5f, 4.0f, 1.5f, 4.0f};
            detail = new PdfPTable(11);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);

            cellDetail = new PdfPCell(new Phrase("สถานภาพสมรส\nMarital Status", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(35);
            cellDetail.setBorder(Rectangle.LEFT | Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(personal_status.equalsIgnoreCase("S")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(35);
            cellDetail.setBorder(Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("โสด\nSingle", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(personal_status.equalsIgnoreCase("")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(35);
            cellDetail.setBorder(Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("สมรส ไม่จดทะเบียน\nMarriage is not registered", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(35);
            cellDetail.setBorder(Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(personal_status.equalsIgnoreCase("M")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(35);
            cellDetail.setBorder(Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("สมรส จดทะเบียน\nMarriage Registration", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(personal_status.equalsIgnoreCase("D")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(35);
            cellDetail.setBorder(Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("หย่า\nDivorced", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(35);
            cellDetail.setBorder(Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(personal_status.equalsIgnoreCase("W")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(35);
            cellDetail.setBorder(Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("ม่าย\nWindow", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(35);
            cellDetail.setBorder(Rectangle.TOP | Rectangle.RIGHT);
            detail.addCell(cellDetail);
            document.add(detail);

            // --------------- new line -----------------
            String military_status = simmapplicantwithgson.mdrop_resumePersonal.military.status;
            sizeColumn = new float[]{15.0f, 2.5f, 15.0f, 2.5f, 15.0f, 2.5f, 15.0f};
            detail = new PdfPTable(7);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);

            cellDetail = new PdfPCell(new Phrase("สถานภาพทางทหาร\nMilitry Status", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(35);
            cellDetail.setBorder(Rectangle.LEFT | Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(military_status.equalsIgnoreCase("1")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(35);
            cellDetail.setBorder(Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("ผ่านการเกณฑ์ทหาร\nMilitry Studied", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(military_status.equalsIgnoreCase("2")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(35);
            cellDetail.setBorder(Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("ยังไม่ได้ผ่านการเกณฑ์ทหาร\nDischarged", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(35);
            cellDetail.setBorder(Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(military_status.equalsIgnoreCase("3")? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(35);
            cellDetail.setBorder(Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("ได้รับการยกเว้น เรื่องจาก\nExempted Reason", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP | Rectangle.RIGHT);
            detail.addCell(cellDetail);

            document.add(detail);


            // --------------- new line -----------------
            sizeColumn = new float[]{100.0f};
            detail = new PdfPTable(1);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);
            setBaseBackgroundColor(60, 175, 74);

            detail.addCell(getCellData("ประวัติครอบครัว (Family Background)", fontHead, false, "CENTER", "BOTTOM", 1, 0, true));
            document.add(detail);
            // --------------- new line -----------------

            sizeColumn = new float[]{15.0f, 30.0f, 5.0f, 15.0f, 10.0f, 25.0f};
            detail = new PdfPTable(6);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);
            setBaseBackgroundColor(188, 249, 183);
            detail.addCell(getCellData("สมาชิก\nMember", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));
            detail.addCell(getCellData("ชื่อ - นามสกุล\nName-Surname", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));
            detail.addCell(getCellData("อายุ\nAge", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));
            detail.addCell(getCellData("อาชีพ\nOccupation", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));
            detail.addCell(getCellData("ตำแหน่ง\nPosition", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));
            detail.addCell(getCellData("สถานที่ทำงาน / เบอร์ติดต่อ\nPlace of work / Telephone", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));

            detail.addCell(getCellData("ชื่อบิดา\nFather'name", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));
            detail.addCell(getCellData(familybackground.get("prefix01").toString()+" "+familybackground.get("fname01").toString() + "   " + familybackground.get("lname01").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(familybackground.get("age01").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(familybackground.get("occupation01").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(familybackground.get("position01").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(familybackground.get("workplace01").toString() + "   " + familybackground.get("phone01").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));

            detail.addCell(getCellData("ชื่อมารดา\nMother'name", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));
            detail.addCell(getCellData(familybackground.get("prefix02").toString()+" "+familybackground.get("fname02").toString() + "   " + familybackground.get("lname02").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(familybackground.get("age02").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(familybackground.get("occupation02").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(familybackground.get("position02").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(familybackground.get("workplace02").toString() + "   " + familybackground.get("phone02").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));

            detail.addCell(getCellData("ชื่อคู่สมรส\nSpouse's name", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));
            detail.addCell(getCellData(familybackground.get("prefix03").toString()+" "+familybackground.get("fname03").toString() + "   " + familybackground.get("lname03").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(familybackground.get("age03").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(familybackground.get("occupation03").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(familybackground.get("position03").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(familybackground.get("workplace03").toString() + "   " + familybackground.get("phone03").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));

            detail.addCell(getCellData("จำนวนบุตร " + childtotal + " คน\nNo.of children", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));
            detail.addCell(getCellData(familybackground.get("prefixallchild")+" "+familybackground.get("nameallchild").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(familybackground.get("ageallchild").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(familybackground.get("occupationallchild").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(familybackground.get("positionallchild").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(familybackground.get("workplaceandphoneallchild").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));


            detail.addCell(getCellData("จำนวนพี่น้อง " + relativetotal + " คน\nNo.of relative", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));
            detail.addCell(getCellData(familybackground.get("nameallrelative").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(familybackground.get("ageallrelative").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(familybackground.get("occupationallrelative").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(familybackground.get("positionallrelative").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(familybackground.get("workplaceandphoneallrelative").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            document.add(detail);

            // --------------- new line -----------------

            sizeColumn = new float[]{50.0f, 20.0f, 30.0f};
            detail = new PdfPTable(3);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);

            cellDetail = new PdfPCell(new Phrase("ชื่อบุคคลที่ติดต่อฉุกเฉิน\nPerson to contact in emergency   :  " +familybackground.get("prefix99")+" "+ familybackground.get("fname99").toString() + "   " + familybackground.get("lname99").toString(), fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(35);
            cellDetail.setBorder(Rectangle.LEFT);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("ความสัมพันธ์\nRelationship", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.NO_BORDER);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("โทรศัพท์\nTelephone   :  " + familybackground.get("phone99").toString(), fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(35);
            cellDetail.setBorder(Rectangle.RIGHT);
            detail.addCell(cellDetail);
            document.add(detail);
            // --------------- new line -----------------
            sizeColumn = new float[]{100.0f};
            detail = new PdfPTable(1);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);

            cellDetail = new PdfPCell(new Phrase("ที่อยู่\nAddress   :  " + familybackground.get("workplace99").toString(), fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(50);
            cellDetail.setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM);
            detail.addCell(cellDetail);

            document.add(detail);

            // --------------- new line -----------------
            sizeColumn = new float[]{50.0f,50.0f};
            detail = new PdfPTable(2);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);

            cellDetail = new PdfPCell(new Phrase(" ", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_BOTTOM);
            cellDetail.setFixedHeight(40);
            cellDetail.setBorder(Rectangle.NO_BORDER);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(" ", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_BOTTOM);
            cellDetail.setFixedHeight(40);
            cellDetail.setBorder(Rectangle.NO_BORDER);
            detail.addCell(cellDetail);

            document.add(detail);

            // --------------- new line -----------------
            sizeColumn = new float[]{90.0f, 10.0f};
            detail = new PdfPTable(2);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(0.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);

            cellDetail = new PdfPCell(new Phrase("DCC/Form:HRD/Issue No.3", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_TOP);
            cellDetail.setBorder(Rectangle.NO_BORDER);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("HRD-FM034", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
            cellDetail.setVerticalAlignment(Element.ALIGN_TOP);
            cellDetail.setBorder(Rectangle.NO_BORDER);
            detail.addCell(cellDetail);
            document.add(detail);

            // --------------- new line -----------------
            sizeColumn = new float[]{95.0f, 5.0f};
            detail = new PdfPTable(2);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);

            cellDetail = new PdfPCell(new Phrase(" ", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(20);
            cellDetail.setBorder(Rectangle.NO_BORDER);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("p.2/2", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.NO_BORDER);
            detail.addCell(cellDetail);

            document.add(detail);
            // --------------- new line -----------------
            sizeColumn = new float[]{100.0f};
            detail = new PdfPTable(1);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);
            setBaseBackgroundColor(60, 175, 74);

            detail.addCell(getCellData("ประวัติการศึกษา Education Background", fontHead, false, "CENTER", "BOTTOM", 1, 0, true));
            document.add(detail);
            // --------------- new line -----------------

            sizeColumn = new float[]{12.0f, 15.0f, 4.0f, 4.0f, 13.0f, 15.0f, 4.0f};
            detail = new PdfPTable(7);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);
            setBaseBackgroundColor(188, 249, 183);
            detail.addCell(getCellData("การศึกษา", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));
            detail.addCell(getCellData("ชื่อสถานศึกษา", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));
            detail.addCell(getCellData("ตั้งแต่", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));
            detail.addCell(getCellData("ถึง", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));
            detail.addCell(getCellData("วุฒิการศึกษา", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));
            detail.addCell(getCellData("สาขา", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));
            detail.addCell(getCellData("เกรด", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));

            detail.addCell(getCellData("ประถมศึกษา", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));
            detail.addCell(getCellData(educationbackground.get("name001").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(educationbackground.get("from001").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(educationbackground.get("to001").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(educationbackground.get("degree001").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(educationbackground.get("major001").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(educationbackground.get("gpa001").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));

            detail.addCell(getCellData("มัธยมศึกษาตอนต้น", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));
            detail.addCell(getCellData(educationbackground.get("name006").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(educationbackground.get("from006").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(educationbackground.get("to006").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(educationbackground.get("degree006").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(educationbackground.get("major006").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(educationbackground.get("gpa006").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));

            detail.addCell(getCellData("มัธยมศึกษาตอนปลาย", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));
            detail.addCell(getCellData(educationbackground.get("name007").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(educationbackground.get("from007").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(educationbackground.get("to007").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(educationbackground.get("degree007").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(educationbackground.get("major007").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(educationbackground.get("gpa007").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));

            detail.addCell(getCellData("อาชีวศึกษา/ปวช.", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));
            detail.addCell(getCellData(educationbackground.get("name004").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(educationbackground.get("from004").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(educationbackground.get("to004").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(educationbackground.get("degree004").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(educationbackground.get("major004").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(educationbackground.get("gpa004").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));

            detail.addCell(getCellData("อนุปริญา/ปวส.", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));
            detail.addCell(getCellData(educationbackground.get("name005").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(educationbackground.get("from005").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(educationbackground.get("to005").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(educationbackground.get("degree005").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(educationbackground.get("major005").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(educationbackground.get("gpa005").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));


            document.add(detail);
            // --------------- new line -----------------
            sizeColumn = new float[]{100.0f};
            detail = new PdfPTable(1);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);
            setBaseBackgroundColor(60, 175, 74);

            detail.addCell(getCellData("ประสบการณ์ทำงาน Work experiences", fontHead, false, "CENTER", "BOTTOM", 1, 0, true));
            document.add(detail);
            // --------------- new line -----------------
            sizeColumn = new float[]{15.0f, 10.0f, 10.0f, 15.0f, 20.0f, 10.0f, 20.0f};
            detail = new PdfPTable(7);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.0f);
            setPaddingRight(3.0f);
            setPaddingBottom(3.0f);
            setBaseBackgroundColor(188, 249, 183);
            detail.addCell(getCellData("ชื่อบริษัท\nCompany Name", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));
            detail.addCell(getCellData("ตั้งแต่\nFrom", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));
            detail.addCell(getCellData("ถึง\nTo", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));
            detail.addCell(getCellData("ตำแหน่ง\nPosition", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));
            detail.addCell(getCellData("หน้าที่ความรับผิดชอบ\nResponsibilities", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));
            detail.addCell(getCellData("อัตราเงินเดือน\nSalary", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));
            detail.addCell(getCellData("เหตุผลที่ลาออก\nReason for leaving", fontHead, false, "CENTER", "MIDDLE", 1, 0, true));

            detail.addCell(getCellData(jobexp.get("companyname_job0").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(jobexp.get("start0").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(jobexp.get("end0").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(jobexp.get("title0").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(jobexp.get("description0").toString() , fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(jobexp.get("salary0").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(jobexp.get("reason0").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));

            detail.addCell(getCellData(jobexp.get("companyname_job1").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(jobexp.get("start1").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(jobexp.get("end1").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(jobexp.get("title1").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(jobexp.get("description1").toString() , fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(jobexp.get("salary1").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(jobexp.get("reason1").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));

            detail.addCell(getCellData(jobexp.get("companyname_job2").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(jobexp.get("start2").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(jobexp.get("end2").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(jobexp.get("title2").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(jobexp.get("description2").toString() , fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(jobexp.get("salary2").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));
            detail.addCell(getCellData(jobexp.get("reason2").toString(), fontHead, false, "CENTER", "MIDDLE", 1, 0, false));





            document.add(detail);

            // --------------- new line -----------------
            sizeColumn = new float[]{100.0f};
            detail = new PdfPTable(1);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);
            setBaseBackgroundColor(60, 175, 74);

            detail.addCell(getCellData("ความสามารถพิเศษ Special Skill", fontHead, false, "CENTER", "BOTTOM", 1, 0, true));
            document.add(detail);
            // --------------- new line -----------------

            sizeColumn = new float[]{20.0f, 10.0f, 10.0f, 10.0f, 10.0f, 40.0f};
            detail = new PdfPTable(6);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);
            setBaseBackgroundColor(188, 249, 183);

            cellDetail = new PdfPCell(new Phrase("ภาษา\nLanguages", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP | Rectangle.LEFT);
            cellDetail.setFixedHeight(25);
            cellDetail.setBackgroundColor(basecolor);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("พูด\nSpeak", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP | Rectangle.LEFT);
            cellDetail.setFixedHeight(25);
            cellDetail.setBackgroundColor(basecolor);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("ฟัง\nListen", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP | Rectangle.LEFT);
            cellDetail.setFixedHeight(25);
            cellDetail.setBackgroundColor(basecolor);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("อ่าน\nRead", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP | Rectangle.LEFT);
            cellDetail.setFixedHeight(25);
            cellDetail.setBackgroundColor(basecolor);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("เขียน\nWrite", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP | Rectangle.LEFT);
            cellDetail.setFixedHeight(25);
            cellDetail.setBackgroundColor(basecolor);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("ความสามารถพิเศษอื่นๆ\nOther Abilities    :    "+simmapplicantwithgson.mdrop_resumeSkill.expertise, fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.LEFT | Rectangle.RIGHT);
            cellDetail.setFixedHeight(25);
            cellDetail.setColspan(2);
            detail.addCell(cellDetail);

            document.add(detail);

            // --------------- new line -----------------

            sizeColumn = new float[]{20.0f, 10.0f, 10.0f, 10.0f, 10.0f, 40.0f};
            detail = new PdfPTable(6);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);
            setBaseBackgroundColor(188, 249, 183);

            cellDetail = new PdfPCell(new Phrase(hmlangskill.get("skillname0").toString(), fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP | Rectangle.LEFT);
            cellDetail.setFixedHeight(25);
            cellDetail.setBackgroundColor(basecolor);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(hmlangskill.get("speak0").toString() , fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP | Rectangle.LEFT);
            cellDetail.setFixedHeight(25);

            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(hmlangskill.get("listen0").toString(), fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP | Rectangle.LEFT);
            cellDetail.setFixedHeight(25);

            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(hmlangskill.get("reading0").toString(), fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP | Rectangle.LEFT);
            cellDetail.setFixedHeight(25);

            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(hmlangskill.get("write0").toString(), fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP | Rectangle.LEFT);
            cellDetail.setFixedHeight(25);

            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("พิมพ์ดีด Typing", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.TOP);
            cellDetail.setFixedHeight(25);
            detail.addCell(cellDetail);

            document.add(detail);

            // --------------- new line -----------------

            sizeColumn = new float[]{20.0f, 10.0f, 10.0f, 10.0f, 10.0f, 40.0f};
            detail = new PdfPTable(6);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);
            setBaseBackgroundColor(188, 249, 183);

            cellDetail = new PdfPCell(new Phrase(hmlangskill.get("skillname1").toString(), fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP | Rectangle.LEFT);
            cellDetail.setFixedHeight(25);
            cellDetail.setBackgroundColor(basecolor);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(hmlangskill.get("speak1").toString() , fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP | Rectangle.LEFT);
            cellDetail.setFixedHeight(25);

            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(hmlangskill.get("listen1").toString(), fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP | Rectangle.LEFT);
            cellDetail.setFixedHeight(25);

            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(hmlangskill.get("reading1").toString(), fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP | Rectangle.LEFT);
            cellDetail.setFixedHeight(25);

            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(hmlangskill.get("write1").toString(), fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP | Rectangle.LEFT);
            cellDetail.setFixedHeight(25);

            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("-ไทย (Thai)   "+simmapplicantwithgson.mdrop_resumeSkill.typing.tha+"   คำ/นาที (wpm.)", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.LEFT | Rectangle.RIGHT);
            cellDetail.setFixedHeight(25);
            detail.addCell(cellDetail);

            document.add(detail);

            // --------------- new line -----------------

            sizeColumn = new float[]{20.0f, 10.0f, 10.0f, 10.0f, 10.0f, 40.0f};
            detail = new PdfPTable(6);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);
            setBaseBackgroundColor(188, 249, 183);

            cellDetail = new PdfPCell(new Phrase(hmlangskill.get("skillname2").toString(), fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP | Rectangle.LEFT);
            cellDetail.setFixedHeight(25);
            cellDetail.setBackgroundColor(basecolor);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(hmlangskill.get("speak2").toString(), fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP | Rectangle.LEFT);
            cellDetail.setFixedHeight(25);

            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(hmlangskill.get("listen2").toString(), fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP | Rectangle.LEFT);
            cellDetail.setFixedHeight(25);

            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(hmlangskill.get("reading2").toString(), fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP | Rectangle.LEFT);
            cellDetail.setFixedHeight(25);

            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(hmlangskill.get("write2").toString(), fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP | Rectangle.LEFT);
            cellDetail.setFixedHeight(25);

            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("-อังกฤษ (English)   "+simmapplicantwithgson.mdrop_resumeSkill.typing.eng+"   คำ/นาที (wpm.)", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.LEFT | Rectangle.RIGHT);
            cellDetail.setFixedHeight(25);
            detail.addCell(cellDetail);

            document.add(detail);

            // --------------- new line -----------------

            sizeColumn = new float[]{60.0f, 40.0f};
            detail = new PdfPTable(2);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);

            cellDetail = new PdfPCell(new Phrase("โปรแกรมคอมพิมเตอร์ที่สามารถใช้ได้\nComputer Program", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP | Rectangle.LEFT | Rectangle.BOTTOM);
            cellDetail.setFixedHeight(35);

            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("งานอดิเรก / กีฬา\nHobbies/Sport   :  " + simmapplicantwithgson.mdrop_resumeSkill.hobbies, fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.TOP | Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM);
            cellDetail.setFixedHeight(35);
            detail.addCell(cellDetail);
            document.add(detail);

            // --------------- new line -----------------
            Boolean car_status = simmapplicantwithgson.mdrop_resumeSkill.vehicle.car.license;
            Boolean motorcycle_status =simmapplicantwithgson.mdrop_resumeSkill.vehicle.motorcycle.license;
            sizeColumn = new float[]{8.0f, 3.0f, 5.0f, 3.0f, 4.0f, 20.0f, 12.0f, 3.0f, 5.0f, 3.0f, 4.0f, 16.0f};
            detail = new PdfPTable(12);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);

            cellDetail = new PdfPCell(new Phrase("ขับรถยนต์", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.LEFT | Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(!car_status? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("ไม่ได้", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(car_status? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("ได้", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("ใบอนุญาติเลขที่   :  "+ simmapplicantwithgson.mdrop_resumeSkill.vehicle.car.number, fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("ขับรถจักรยานยนต์", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(!motorcycle_status? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("ไม่ได้", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(motorcycle_status? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("ได้", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.TOP);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("ใบอนุญาติเลขที่ :  "+ simmapplicantwithgson.mdrop_resumeSkill.vehicle.motorcycle.number, fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.TOP | Rectangle.RIGHT);
            detail.addCell(cellDetail);
            document.add(detail);

            // --------------- new line -----------------
            Boolean car_own =simmapplicantwithgson.mdrop_resumeSkill.vehicle.car.own;
            Boolean motorcycle_own =simmapplicantwithgson.mdrop_resumeSkill.vehicle.motorcycle.own;
            sizeColumn = new float[]{13.0f, 3.0f, 3.0f, 3.5f, 4.0f, 20.0f, 16.0f, 3.0f, 5.0f, 3.0f, 5.0f, 20.0f};
            detail = new PdfPTable(12);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);

            cellDetail = new PdfPCell(new Phrase("รถยนต์ส่วนตัว", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.LEFT | Rectangle.BOTTOM);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(car_own? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.BOTTOM);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("มี", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.BOTTOM);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(!car_own? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.BOTTOM);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("ไม่มี", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.BOTTOM);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("ทะเบียน  :  " , fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.BOTTOM);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("รถจักรยานยนต์ส่วนตัว", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.BOTTOM);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(motorcycle_own? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.BOTTOM);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("มี", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.BOTTOM);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(!motorcycle_own? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.BOTTOM);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("ไม่มี", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.BOTTOM);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("ทะเบียน   :  " , fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.BOTTOM | Rectangle.RIGHT);
            detail.addCell(cellDetail);
            document.add(detail);

            // --------------- new line -----------------

            sizeColumn = new float[]{80.0f, 30.0f};
            detail = new PdfPTable(2);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);

            cellDetail = new PdfPCell(new Phrase("ท่านมีคนรู้จักหรือบุคคลที่แนะนำท่านมาสมัครที่บริษัทนี้คือ :  ชื่อ-นามสกุล  " + nameregroup + "  " + lnameregroup, fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(20);
            cellDetail.setBorder(Rectangle.LEFT);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("แผนก/ฝ้าย :   " + positionregroup, fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.RIGHT);
            detail.addCell(cellDetail);

            document.add(detail);

            // --------------- new line -----------------

            sizeColumn = new float[]{20.0f, 4.0f, 10.0f, 4.0f, 10.0f, 20.0f, 4.0f, 8.0f, 4.0f, 8.0f,};
            detail = new PdfPTable(10);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);

            cellDetail = new PdfPCell(new Phrase("ท่านเคยติดยาเสพหรือไม่", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.LEFT);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.NO_BORDER);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("ไม่เคย", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.NO_BORDER);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.NO_BORDER);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("เคย", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.NO_BORDER);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("ปัจจุบันท่านสูบบุหรี่หรือไม่", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.NO_BORDER);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.NO_BORDER);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("สูบ", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.NO_BORDER);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.NO_BORDER);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("ไม่สูบ", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.RIGHT);
            detail.addCell(cellDetail);
            document.add(detail);

            // --------------- new line -----------------
            Boolean health_status =simmapplicantwithgson.mdrop_resumeOther.health.status;
            sizeColumn = new float[]{80.0f, 10.0f, 10.0f, 10.0f, 10.0f};
            detail = new PdfPTable(5);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);

            cellDetail = new PdfPCell(new Phrase("ในระยะเวลา 5 ปีที่ผ่านมาท่านเคยป่วยหนักหรือต้องเข้ารับการรักษาที่โรงพยาบาลหรือไม่", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.LEFT);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(health_status? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.NO_BORDER);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("เคย", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.NO_BORDER);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase(!health_status? AwesomeIcons.ICON_CHECK:AwesomeIcons.ICON_CHECK_EMPTY, fontAwesome));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.NO_BORDER);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("ไม่เคย", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.RIGHT);
            detail.addCell(cellDetail);

            document.add(detail);
            // --------------- new line -----------------

            sizeColumn = new float[]{50.0f, 50.0f};
            detail = new PdfPTable(2);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);

            cellDetail = new PdfPCell(new Phrase("ถ้าเคยโปรดระบุรายละเอียดที่ป่วย   :    "+simmapplicantwithgson.mdrop_resumeOther.health.explain, fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.LEFT | Rectangle.BOTTOM);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("สถานที่รักษา.................................................................................", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(25);
            cellDetail.setBorder(Rectangle.BOTTOM | Rectangle.RIGHT);
            detail.addCell(cellDetail);

            document.add(detail);

            // --------------- new line -----------------

            sizeColumn = new float[]{100.0f};
            detail = new PdfPTable(1);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);

            cellDetail = new PdfPCell(new Phrase("       ข้าพเจ้าขอรับรองว่าข้อความทั้งหทดเป็นความจริงทุกประการ สมบูนณ์และถูกต้องที่สุดเท่าที่ข้าพเจ้าทราบ และเชื่อมั่นและได้กระทำด้วย \nความซื่อสัตย์ หากเป็นเท็จหรือบิดเบือนจากความเป็นจริงให้ถือเป็นเหตุเลิกจ้างข้าพเจ้าโดยไม่ต้องจ่ายชดเชยใดๆทั้งสิน", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(30);
            cellDetail.setBorder(Rectangle.LEFT | Rectangle.RIGHT);
            detail.addCell(cellDetail);

            document.add(detail);

            // --------------- new line -----------------

            sizeColumn = new float[]{100.0f};
            detail = new PdfPTable(1);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);

            cellDetail = new PdfPCell(new Phrase("       I certify that all of the statrment made in this application are ture,complete and correct to the best on my knowledge \nand bellef and made in good faith", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setPaddingLeft(paddingleft);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(30);
            cellDetail.setBorder(Rectangle.LEFT | Rectangle.RIGHT);
            detail.addCell(cellDetail);

            document.add(detail);

            // --------------- new line -----------------

            sizeColumn = new float[]{50.0f, 50.0f};
            detail = new PdfPTable(2);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);

            cellDetail = new PdfPCell(new Phrase(" ", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(20);
            cellDetail.setBorder(Rectangle.LEFT);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("ลงชื่อ (Signature)......................................................", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.RIGHT);
            detail.addCell(cellDetail);

            document.add(detail);
// --------------- new line -----------------

            sizeColumn = new float[]{60.0f, 40.0f};
            detail = new PdfPTable(2);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);

            cellDetail = new PdfPCell(new Phrase("  ", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(20);
            cellDetail.setBorder(Rectangle.LEFT);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("(.............................................)", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setBorder(Rectangle.RIGHT);
            detail.addCell(cellDetail);
            document.add(detail);

            // --------------- new line -----------------

            sizeColumn = new float[]{60.0f, 40.0f};
            detail = new PdfPTable(2);
            detail.setWidthPercentage(100);
            detail.setWidths(sizeColumn);
            setPaddingTop(1.0f);
            setPaddingLeft(3.5f);
            setPaddingRight(3.5f);
            setPaddingBottom(4.5f);

            cellDetail = new PdfPCell(new Phrase("  ", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(20);
            cellDetail.setBorder(Rectangle.LEFT | Rectangle.BOTTOM);
            detail.addCell(cellDetail);

            cellDetail = new PdfPCell(new Phrase("วันที่(Date)______/_____/_____", fontHead));
            cellDetail.setPadding(padding);
            cellDetail.setPaddingTop(paddingtop);
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
            cellDetail.setFixedHeight(20);
            cellDetail.setBorder(Rectangle.RIGHT | Rectangle.BOTTOM);
            detail.addCell(cellDetail);
            document.add(detail);
// --------------- new line -----------------

        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            document.close();
        }
    }

    if (hasData) {
        OutputStream os = response.getOutputStream();
        // Create a reader
        PdfReader reader = new PdfReader(baos.toByteArray());
        // Create a stamper
        PdfStamper stamper = new PdfStamper(reader, baos);

        // Close the stamper
        stamper.close();
        reader.close();

        response.setHeader("Expires", "0");
        response.setHeader("Cache-Control", "must-revalidate, post-check=0 , pre-check=0");
        response.setHeader("Pragma", "public");
        // setting the content type
        response.setContentType("application/pdf");
        // the contentlength
        response.setContentLength(baos.size());
        // write ByteArrayOutputStream to the ServletOutputStream

        baos.writeTo(os);

        os.flush();
        os.close();
    }

%>

<%!
    Float padding = 0.0f;
    Float paddingtop = 0.0f;
    Float paddingbottom = 0.0f;
    Float paddingleft = 0.0f;
    Float paddingright = 0.0f;
    BaseColor basecolor = new BaseColor(0, 0, 0);

    private PdfPCell getCellData(String text, Font font, boolean noborder, String horalign, String veralign, int colspan, int rowspan) {
        return getCellData(text, font, noborder, horalign, veralign, colspan, rowspan, false);
    }

    private PdfPCell getCellData(String text, Font font, boolean noborder, String horalign, String veralign, int colspan, int rowspan, boolean bgcolor) {
        PdfPCell cellDetail = new PdfPCell(new Phrase(text, font));

        if (horalign.equalsIgnoreCase("LEFT")) {
            cellDetail.setHorizontalAlignment(Element.ALIGN_LEFT);
        } else if (horalign.equalsIgnoreCase("CENTER")) {
            cellDetail.setHorizontalAlignment(Element.ALIGN_CENTER);
        } else if (horalign.equalsIgnoreCase("RIGHT")) {
            cellDetail.setHorizontalAlignment(Element.ALIGN_RIGHT);
        }

        if (veralign.equalsIgnoreCase("TOP")) {
            cellDetail.setVerticalAlignment(Element.ALIGN_TOP);
        } else if (veralign.equalsIgnoreCase("MIDDLE")) {
            cellDetail.setVerticalAlignment(Element.ALIGN_MIDDLE);
        } else if (veralign.equalsIgnoreCase("BOTTOM")) {
            cellDetail.setVerticalAlignment(Element.ALIGN_BOTTOM);
        }

        if (padding > 0.0f) {
            cellDetail.setPadding(padding);
        }
        if (paddingtop > 0.0f) {
            cellDetail.setPaddingTop(paddingtop);
        }
        if (paddingbottom > 0.0f) {
            cellDetail.setPaddingBottom(paddingbottom);
        }
        if (paddingleft > 0.0f) {
            cellDetail.setPaddingLeft(paddingleft);
        }
        if (paddingright > 0.0f) {
            cellDetail.setPaddingRight(paddingright);
        }
        if (colspan > 0) {
            cellDetail.setColspan(colspan);
        }
        if (rowspan > 0) {
            cellDetail.setRowspan(rowspan);
        }
        if (noborder) {
            cellDetail.setBorder(Rectangle.NO_BORDER);
        }
        if (bgcolor) {
            cellDetail.setBackgroundColor(basecolor);
        }

        return cellDetail;
    }

    private void setPadding(Float padding) {
        this.padding = padding;
    }

    private void setPaddingTop(Float padding) {
        this.paddingtop = padding;
    }

    private void setPaddingBottom(Float padding) {
        this.paddingbottom = padding;
    }

    private void setPaddingLeft(Float padding) {
        this.paddingleft = padding;
    }

    private void setPaddingRight(Float padding) {
        this.paddingright = padding;
    }

    private void setBaseBackgroundColor(int r, int g, int b) {
        this.basecolor = new BaseColor(r, g, b);
    }


%>

</body>
</html>