List of usage examples for com.itextpdf.text Phrase Phrase
public Phrase(final float leading, final String string)
Phrase
with a certain leading and a certain String
. From source file:com.planning.project.controller.CreatePDF.java
private static void createTable(Document document) throws DocumentException, IOException { Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED)); font.setSize(16);/* w w w .j a v a 2 s . c o m*/ Paragraph paragraph = new Paragraph(); paragraph.setFont(font); creteEmptyLine(paragraph, 2); document.add(paragraph); PdfPTable table = new PdfPTable(7); paragraph.add(""); PdfPCell c1 = new PdfPCell(new Phrase("asasas", font)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase("/?", font)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase("?", font)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); TbActivity ac = new TbActivity(); c1 = new PdfPCell(new Phrase("", font)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase("", font)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase("", font)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase("", font)); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); table.setHeaderRows(1); paragraph.add(""); for (int i = 0; i < 7; i++) { table.setWidthPercentage(100); table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER); table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE); table.addCell(paragraph); } document.add(table); }
From source file:com.planning.project.controller.CreatePDF.java
public static PdfPTable createtableTargetGroup(TbTargetgroup targetGroup) throws DocumentException, Exception { Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED)); font.setSize(16);/* w ww .j av a 2s.co m*/ PdfPTable table = new PdfPTable(3); table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER); table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE); PdfPCell cell = new PdfPCell(new Phrase("? ", font)); cell.setColspan(5); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("?()", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase( " ()", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); table.addCell(new PdfPCell(new Phrase("", font))); table.addCell(new PdfPCell(new Phrase(targetGroup.getJooutMana(), font))); table.addCell(new PdfPCell(new Phrase(targetGroup.getJoinMana(), font))); table.addCell(new PdfPCell(new Phrase("", font))); table.addCell(new PdfPCell(new Phrase(targetGroup.getJooutTeach(), font))); table.addCell(new PdfPCell(new Phrase(targetGroup.getJoinTeach(), font))); table.addCell(new PdfPCell(new Phrase("", font))); table.addCell(new PdfPCell(new Phrase(targetGroup.getJooutEmp(), font))); table.addCell(new PdfPCell(new Phrase(targetGroup.getJoinEmp(), font))); table.addCell(new PdfPCell(new Phrase("??", font))); table.addCell(new PdfPCell(new Phrase(targetGroup.getJooutStu(), font))); table.addCell(new PdfPCell(new Phrase(targetGroup.getJoinStu(), font))); table.addCell(new PdfPCell(new Phrase("/?", font))); table.addCell(new PdfPCell(new Phrase(targetGroup.getJooutCommu(), font))); table.addCell(new PdfPCell(new Phrase(targetGroup.getJoinCommu(), font))); table.addCell( new PdfPCell(new Phrase("?/?", font))); table.addCell(new PdfPCell(new Phrase(targetGroup.getJooutDisable(), font))); table.addCell(new PdfPCell(new Phrase(targetGroup.getJoinDisable(), font))); table.addCell(new PdfPCell(new Phrase("", font))); table.addCell(new PdfPCell(new Phrase(targetGroup.getJooutOther(), font))); table.addCell(new PdfPCell(new Phrase(targetGroup.getJoinOther(), font))); return table; }
From source file:com.planning.project.controller.CreatePDF.java
public static PdfPTable createtableTargetGroup2(TbTargetgroup targetGroup) throws DocumentException, Exception { Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED)); font.setSize(16);/*from www .j a v a2s . c o m*/ PdfPTable table = new PdfPTable(3); table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER); table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE); PdfPCell cell = new PdfPCell(new Phrase("?", font)); cell.setColspan(5); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("?()", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase( " ()", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); table.addCell(new PdfPCell(new Phrase("", font))); table.addCell(new PdfPCell(new Phrase(targetGroup.getActoutMana(), font))); table.addCell(new PdfPCell(new Phrase(targetGroup.getActinMana(), font))); table.addCell(new PdfPCell(new Phrase("", font))); table.addCell(new PdfPCell(new Phrase(targetGroup.getActoutTeach(), font))); table.addCell(new PdfPCell(new Phrase(targetGroup.getActinTeach(), font))); table.addCell(new PdfPCell(new Phrase("", font))); table.addCell(new PdfPCell(new Phrase(targetGroup.getActoutEmp(), font))); table.addCell(new PdfPCell(new Phrase(targetGroup.getActinEmp(), font))); table.addCell(new PdfPCell(new Phrase("??", font))); table.addCell(new PdfPCell(new Phrase(targetGroup.getActoutStu(), font))); table.addCell(new PdfPCell(new Phrase(targetGroup.getJoinStu(), font))); table.addCell(new PdfPCell(new Phrase("?", font))); table.addCell(new PdfPCell(new Phrase(targetGroup.getActoutLect(), font))); table.addCell(new PdfPCell(new Phrase(targetGroup.getActinLect(), font))); return table; }
From source file:com.planning.project.controller.CreatePDF.java
public static PdfPTable createtableFollowCheck(TbFormSubproject subProject) throws DocumentException, Exception { Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED)); font.setSize(16);/*from www .ja va 2 s. com*/ PdfPTable table = new PdfPTable(3); table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER); table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE); PdfPCell cell = new PdfPCell(new Phrase( "?? (C_Check)", font)); cell.setColspan(3); table.addCell(cell); cell = new PdfPCell(new Phrase("?", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase( "??", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("?", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); table.addCell(new PdfPCell(new Phrase( "????", font))); table.addCell(new PdfPCell(new Phrase(subProject.getFollowCCheckTool(), font))); table.addCell(new PdfPCell(new Phrase(subProject.getFollowCCheckTime(), font))); table.addCell(new PdfPCell(new Phrase( "??", font))); table.addCell(new PdfPCell(new Phrase(subProject.getAssesCCheckTool(), font))); table.addCell(new PdfPCell(new Phrase(subProject.getAssesCCheckTime(), font))); table.addCell(new PdfPCell(new Phrase( "?? /", font))); table.addCell(new PdfPCell(new Phrase(subProject.getFollowInCCheckTool(), font))); table.addCell(new PdfPCell(new Phrase(subProject.getFollowInCCheckTime(), font))); return table; }
From source file:com.planning.project.controller.CreatePDF.java
public static PdfPTable createtablePro(TbFormProject tbFormProject) throws DocumentException, Exception { Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED)); font.setSize(16);//www.j a v a2 s .c o m PdfPTable table = new PdfPTable(5); table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER); table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE); PdfPCell cell = new PdfPCell(new Phrase( "/ :/", font)); cell.setColspan(5); table.addCell(cell); cell = new PdfPCell( new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); table.addCell(new PdfPCell(new Phrase("", font))); table.addCell(new PdfPCell(new Phrase(tbFormProject.getProQuantitative(), font))); table.addCell(new PdfPCell(new Phrase(tbFormProject.getProQualitative(), font))); table.addCell(new PdfPCell(new Phrase(tbFormProject.getProTiming(), font))); table.addCell(new PdfPCell(new Phrase(tbFormProject.getProCost(), font))); table.addCell(new PdfPCell(new Phrase("", font))); table.addCell(new PdfPCell(new Phrase(tbFormProject.getAnsQuantitative(), font))); table.addCell(new PdfPCell(new Phrase(tbFormProject.getAnsQualtitative(), font))); table.addCell(new PdfPCell(new Phrase(tbFormProject.getAnsTiming(), font))); table.addCell(new PdfPCell(new Phrase(tbFormProject.getAnsCost(), font))); return table; }
From source file:com.planning.project.controller.CreatePDF.java
public static PdfPTable createtableAddmoneyvara(List<TbAddmoneyvara> tbAddmoneyvaras, String getSumAddmoneyvara) throws DocumentException, Exception { Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED)); font.setSize(16);//w ww . j a va 2 s .c o m PdfPTable table = new PdfPTable(5); table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER); table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE); PdfPCell cell = new PdfPCell(new Phrase( "1.1 ? () ??? ", font)); cell.setColspan(5); table.addCell(cell); cell = new PdfPCell( new Phrase(" = " + getSumAddmoneyvara + " ", font)); cell.setColspan(5); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("-?", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("?", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase(" /", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase(" / ", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); int count = 0; for (TbAddmoneyvara items : tbAddmoneyvaras) { count++; table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font))); table.addCell(new PdfPCell(new Phrase( items.getTbPerson().getPersonName() + " " + items.getTbPerson().getPersonLastname(), font))); table.addCell(new PdfPCell(new Phrase(items.getAddmvaraDate().toString(), font))); table.addCell(new PdfPCell(new Phrase(items.getAddmvaraPrice(), font))); table.addCell(new PdfPCell(new Phrase(items.getAddmvaraSum(), font))); } return table; }
From source file:com.planning.project.controller.CreatePDF.java
public static PdfPTable createtableAddmoneynovara(List<TbAddmoneynovara> tbAddmoneynovaras, String getSumAddmoneynovara) throws DocumentException, Exception { Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED)); font.setSize(16);/*from w w w . j a v a 2s. co m*/ PdfPTable table = new PdfPTable(5); table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER); table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE); PdfPCell cell = new PdfPCell(new Phrase( "1.2 ? () ??? ", font)); cell.setColspan(5); table.addCell(cell); cell = new PdfPCell( new Phrase(" = " + getSumAddmoneynovara + " ", font)); cell.setColspan(5); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("-?", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("?", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase(" /", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase(" / ", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); int count = 0; for (TbAddmoneynovara items : tbAddmoneynovaras) { count++; table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font))); table.addCell(new PdfPCell(new Phrase( items.getTbPerson().getPersonName() + " " + items.getTbPerson().getPersonLastname(), font))); table.addCell(new PdfPCell(new Phrase(items.getAddmnovaraDate().toString(), font))); table.addCell(new PdfPCell(new Phrase(items.getAddmnovaraPrice(), font))); table.addCell(new PdfPCell(new Phrase(items.getAddmnovaraSum(), font))); } return table; }
From source file:com.planning.project.controller.CreatePDF.java
public static PdfPTable createtableRemunerationcommittee(List<TbRemunerationcommittee> tbRemunerationcommittees, String getSumRemunerationcommittees) throws DocumentException, Exception { Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED)); font.setSize(16);/* w w w . j av a 2 s. c o m*/ PdfPTable table = new PdfPTable(6); table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER); table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE); PdfPCell cell = new PdfPCell( new Phrase("1.3?? ", font)); cell.setColspan(6); table.addCell(cell); cell = new PdfPCell(new Phrase( " = " + getSumRemunerationcommittees + " ", font)); cell.setColspan(6); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("??", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); int count = 0; for (TbRemunerationcommittee items : tbRemunerationcommittees) { count++; table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font))); table.addCell(new PdfPCell(new Phrase(items.getRemunQty(), font))); table.addCell(new PdfPCell(new Phrase(items.getRemunPrice(), font))); table.addCell(new PdfPCell(new Phrase(items.getRemunTime(), font))); table.addCell(new PdfPCell(new Phrase(items.getRemunSum(), font))); table.addCell(new PdfPCell(new Phrase(items.getRemunRemark(), font))); } return table; }
From source file:com.planning.project.controller.CreatePDF.java
public static PdfPTable createtableMaketimeformeal(List<TbMaketimeformeal> tbMaketimeformeals, String getSumMaketimeformeals) throws DocumentException, Exception { Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED)); font.setSize(16);// w w w .ja va2 s. c o m PdfPTable table = new PdfPTable(7); table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER); table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE); PdfPCell cell = new PdfPCell( new Phrase("1.4 ??", font)); cell.setColspan(7); table.addCell(cell); cell = new PdfPCell( new Phrase(" = " + getSumMaketimeformeals + " ", font)); cell.setColspan(7); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("??", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); int count = 0; for (TbMaketimeformeal items : tbMaketimeformeals) { count++; table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font))); table.addCell(new PdfPCell(new Phrase(items.getWork(), font))); table.addCell(new PdfPCell(new Phrase(items.getJobovertime(), font))); table.addCell(new PdfPCell(new Phrase(items.getPerformerquantityperson(), font))); table.addCell(new PdfPCell(new Phrase(items.getPerformerquantityday(), font))); table.addCell(new PdfPCell(new Phrase(items.getPerformerquantitymoney(), font))); table.addCell(new PdfPCell(new Phrase(items.getPerformerquantitymoneytotal(), font))); } return table; }
From source file:com.planning.project.controller.CreatePDF.java
public static PdfPTable createtableRentshouse(List<TbRentshouse> tbRentshouses, String getSumRentshouses) throws DocumentException, Exception { Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED)); font.setSize(16);//from w ww . jav a 2 s . c o m PdfPTable table = new PdfPTable(4); table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER); table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE); PdfPCell cell = new PdfPCell(new Phrase("1.5 ", font)); cell.setColspan(4); table.addCell(cell); cell = new PdfPCell( new Phrase(" = " + getSumRentshouses + " ", font)); cell.setColspan(4); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase(" - ?", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("/", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase(" / ", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); int count = 0; for (TbRentshouse items : tbRentshouses) { count++; table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font))); table.addCell(new PdfPCell(new Phrase( items.getTbPerson().getPersonName() + " " + items.getTbPerson().getPersonLastname(), font))); table.addCell(new PdfPCell(new Phrase(items.getRentshousePrice(), font))); table.addCell(new PdfPCell(new Phrase(items.getRentshouseSum(), font))); } return table; }