List of usage examples for com.itextpdf.text.pdf BaseFont IDENTITY_H
String IDENTITY_H
To view the source code for com.itextpdf.text.pdf BaseFont IDENTITY_H.
Click Source Link
From source file:com.planning.project.controller.CreatePDF.java
public static PdfPTable createtableMaterial4(List<TbMaterial> tbMaterials4, String getSum) throws DocumentException, Exception { Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED)); font.setSize(16);/*from ww w . ja v a 2s . com*/ PdfPTable table = new PdfPTable(6); table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER); table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE); PdfPCell cell = new PdfPCell( new Phrase("3.4 ?", font)); cell.setColspan(6); table.addCell(cell); cell = new PdfPCell(new Phrase(" = " + getSum + " ", font)); cell.setColspan(6); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("??", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); int count = 0; for (TbMaterial items : tbMaterials4) { count++; table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font))); table.addCell(new PdfPCell(new Phrase(items.getMName(), font))); table.addCell(new PdfPCell(new Phrase(items.getMQty(), font))); table.addCell(new PdfPCell(new Phrase(items.getMNub(), font))); table.addCell(new PdfPCell(new Phrase(items.getMPrice(), font))); table.addCell(new PdfPCell(new Phrase(items.getMTotal(), font))); } return table; }
From source file:com.planning.project.controller.CreatePDF.java
public static PdfPTable createtableMaterial5(List<TbMaterial> tbMaterials5, String getSum) throws DocumentException, Exception { Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED)); font.setSize(16);//from ww w . ja v a 2 s . co m PdfPTable table = new PdfPTable(6); table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER); table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE); PdfPCell cell = new PdfPCell(new Phrase( "3.5 ??", font)); cell.setColspan(6); table.addCell(cell); cell = new PdfPCell(new Phrase(" = " + getSum + " ", font)); cell.setColspan(6); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("??", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); int count = 0; for (TbMaterial items : tbMaterials5) { count++; table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font))); table.addCell(new PdfPCell(new Phrase(items.getMName(), font))); table.addCell(new PdfPCell(new Phrase(items.getMQty(), font))); table.addCell(new PdfPCell(new Phrase(items.getMNub(), font))); table.addCell(new PdfPCell(new Phrase(items.getMPrice(), font))); table.addCell(new PdfPCell(new Phrase(items.getMTotal(), font))); } return table; }
From source file:com.planning.project.controller.CreatePDF.java
public static PdfPTable createtableMaterial6(List<TbMaterial> tbMaterials6, String getSum) throws DocumentException, Exception { Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED)); font.setSize(16);/* ww w . j av a 2 s .co m*/ PdfPTable table = new PdfPTable(6); table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER); table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE); PdfPCell cell = new PdfPCell(new Phrase("3.6 ??", font)); cell.setColspan(6); table.addCell(cell); cell = new PdfPCell(new Phrase(" = " + getSum + " ", font)); cell.setColspan(6); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("??", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); int count = 0; for (TbMaterial items : tbMaterials6) { count++; table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font))); table.addCell(new PdfPCell(new Phrase(items.getMName(), font))); table.addCell(new PdfPCell(new Phrase(items.getMQty(), font))); table.addCell(new PdfPCell(new Phrase(items.getMNub(), font))); table.addCell(new PdfPCell(new Phrase(items.getMPrice(), font))); table.addCell(new PdfPCell(new Phrase(items.getMTotal(), font))); } return table; }
From source file:com.planning.project.controller.CreatePDF.java
public static PdfPTable createtableMaterial7(List<TbMaterial> tbMaterials7, String getSum) throws DocumentException, Exception { Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED)); font.setSize(16);//from www. j a v a2 s .c om PdfPTable table = new PdfPTable(6); table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER); table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE); PdfPCell cell = new PdfPCell(new Phrase("3.7 ", font)); cell.setColspan(6); table.addCell(cell); cell = new PdfPCell(new Phrase(" = " + getSum + " ", font)); cell.setColspan(6); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("??", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); int count = 0; for (TbMaterial items : tbMaterials7) { count++; table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font))); table.addCell(new PdfPCell(new Phrase(items.getMName(), font))); table.addCell(new PdfPCell(new Phrase(items.getMQty(), font))); table.addCell(new PdfPCell(new Phrase(items.getMNub(), font))); table.addCell(new PdfPCell(new Phrase(items.getMPrice(), font))); table.addCell(new PdfPCell(new Phrase(items.getMTotal(), font))); } return table; }
From source file:com.planning.project.controller.CreatePDF.java
public static PdfPTable createtableMaterial8(List<TbMaterial> tbMaterials8, String getSum) throws DocumentException, Exception { Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED)); font.setSize(16);/*from w w w .j av a 2s. c om*/ PdfPTable table = new PdfPTable(6); table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER); table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE); PdfPCell cell = new PdfPCell(new Phrase("3.8 ??", font)); cell.setColspan(6); table.addCell(cell); cell = new PdfPCell(new Phrase(" = " + getSum + " ", font)); cell.setColspan(6); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("??", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); int count = 0; for (TbMaterial items : tbMaterials8) { count++; table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font))); table.addCell(new PdfPCell(new Phrase(items.getMName(), font))); table.addCell(new PdfPCell(new Phrase(items.getMQty(), font))); table.addCell(new PdfPCell(new Phrase(items.getMNub(), font))); table.addCell(new PdfPCell(new Phrase(items.getMPrice(), font))); table.addCell(new PdfPCell(new Phrase(items.getMTotal(), font))); } return table; }
From source file:com.planning.project.controller.CreatePDF.java
public static PdfPTable createtableMaterial9(List<TbMaterial> tbMaterials9, String getSum) throws DocumentException, Exception { Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED)); font.setSize(16);//from w w w . j a v a2s . 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("3.9 ", font)); cell.setColspan(6); table.addCell(cell); cell = new PdfPCell(new Phrase(" = " + getSum + " ", font)); cell.setColspan(6); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("??", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); int count = 0; for (TbMaterial items : tbMaterials9) { count++; table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font))); table.addCell(new PdfPCell(new Phrase(items.getMName(), font))); table.addCell(new PdfPCell(new Phrase(items.getMQty(), font))); table.addCell(new PdfPCell(new Phrase(items.getMNub(), font))); table.addCell(new PdfPCell(new Phrase(items.getMPrice(), font))); table.addCell(new PdfPCell(new Phrase(items.getMTotal(), font))); } return table; }
From source file:com.planning.project.controller.CreatePDF.java
public static PdfPTable createtableMaterial10(List<TbMaterial> tbMaterials10, String getSum) throws DocumentException, Exception { Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED)); font.setSize(16);/*w w w .j a v a 2 s . c o m*/ PdfPTable table = new PdfPTable(6); table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER); table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE); PdfPCell cell = new PdfPCell( new Phrase("3.10 ???", font)); cell.setColspan(6); table.addCell(cell); cell = new PdfPCell(new Phrase(" = " + getSum + " ", font)); cell.setColspan(6); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("??", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); int count = 0; for (TbMaterial items : tbMaterials10) { count++; table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font))); table.addCell(new PdfPCell(new Phrase(items.getMName(), font))); table.addCell(new PdfPCell(new Phrase(items.getMQty(), font))); table.addCell(new PdfPCell(new Phrase(items.getMNub(), font))); table.addCell(new PdfPCell(new Phrase(items.getMPrice(), font))); table.addCell(new PdfPCell(new Phrase(items.getMTotal(), font))); } return table; }
From source file:com.planning.project.controller.CreatePDF.java
public static PdfPTable createtableMaterial11(List<TbMaterial> tbMaterials11, String getSum) throws DocumentException, Exception { Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED)); font.setSize(16);//from w w w. j a va 2 s.co m PdfPTable table = new PdfPTable(6); table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER); table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE); PdfPCell cell = new PdfPCell(new Phrase("3.11 ", font)); cell.setColspan(6); table.addCell(cell); cell = new PdfPCell(new Phrase(" = " + getSum + " ", font)); cell.setColspan(6); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("??", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); int count = 0; for (TbMaterial items : tbMaterials11) { count++; table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font))); table.addCell(new PdfPCell(new Phrase(items.getMName(), font))); table.addCell(new PdfPCell(new Phrase(items.getMQty(), font))); table.addCell(new PdfPCell(new Phrase(items.getMNub(), font))); table.addCell(new PdfPCell(new Phrase(items.getMPrice(), font))); table.addCell(new PdfPCell(new Phrase(items.getMTotal(), font))); } return table; }
From source file:com.planning.project.controller.CreatePDF.java
public static PdfPTable createtablePublicutility(List<TbPublicutility> tbPublicutilitys, String getSum) throws DocumentException, Exception { Font font = new Font(BaseFont.createFont("D:/THSarabunNew.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED)); font.setSize(16);/*from w w w .j av a 2s. c om*/ PdfPTable table = new PdfPTable(6); table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER); table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE); PdfPCell cell = new PdfPCell( new Phrase("4.1 ?", font)); cell.setColspan(6); table.addCell(cell); cell = new PdfPCell(new Phrase(" = " + getSum + " ", font)); cell.setColspan(6); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); cell = new PdfPCell(new Phrase("", font)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(cell); int count = 0; for (TbPublicutility items : tbPublicutilitys) { count++; table.addCell(new PdfPCell(new Phrase(String.valueOf(count), font))); table.addCell(new PdfPCell(new Phrase(items.getPubEle(), font))); table.addCell(new PdfPCell(new Phrase(items.getPubWater(), font))); table.addCell(new PdfPCell(new Phrase(items.getPubTel(), font))); table.addCell(new PdfPCell(new Phrase(items.getPubEms(), font))); table.addCell(new PdfPCell(new Phrase(items.getPubOther(), font))); table.addCell(new PdfPCell(new Phrase(items.getPubSum(), font))); } return table; }
From source file:com.poscoict.license.service.CertificateService.java
private Font getFont(Fonts name) { try {//from w w w. j av a2s .co m BaseFont baseFont = BaseFont.createFont(Consts.FONT_FILE_PATH, BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED); switch (name) { case FONT12NOAML: this.FONT = new Font(baseFont, 12, Font.NORMAL); break; case FONT12BOLD: this.FONT = new Font(baseFont, 12, Font.BOLD); break; case FONT18NOAML: this.FONT = new Font(baseFont, 18, Font.NORMAL); break; case FONT20BOLD: this.FONT = new Font(baseFont, 20, Font.BOLD); break; default: this.FONT = new Font(baseFont, 12, Font.NORMAL); } } catch (DocumentException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return this.FONT; }