List of usage examples for com.itextpdf.text.pdf PdfPCell PdfPCell
public PdfPCell(PdfPCell cell)
PdfPCell
. From source file:com.solidmaps.webapp.report.RequerimentAlterLicenseFederalPDF.java
private void createTable(Document doc, RequerimentFederalEnum type, LicensePFEntity license, List<ProductOfficialEntity> listProducts) throws DocumentException { // create PDF table with the given widths PdfPTable table = new PdfPTable(4); // set table width a percentage of the page width table.setWidthPercentage(100f);/*from ww w .j av a 2 s .c om*/ this.createCompany(table, license); // Alterao Cadastral this.createAlteracaoCadastral(table, type); // Descrio this.insertHeaderCell(table, "3 - DESCREVER AS PRINCIPAIS ALTERAES OCORRIDAS", 4); this.insertCell(table, this.createProductsText(listProducts, type), 4); // Uso Oficial this.insertCellProtocol(table, license); // Footer this.createFooter(table); // Table pai PdfPTable tableFather = new PdfPTable(1); tableFather.setWidthPercentage(100f); PdfPCell cellFather = new PdfPCell(table); cellFather.setBorderWidth(2); tableFather.addCell(cellFather); doc.add(this.createHeader()); doc.add(tableFather); }
From source file:com.solidmaps.webapp.report.RequerimentAlterLicenseFederalPDF.java
private void createFooter(PdfPTable table) { this.insertHeaderCell(table, "Portaria 1.274/03", 4); Paragraph artigo = new Paragraph("Art. 6", FONT_HEADER); Paragraph text1 = new Paragraph( "A pessoa jurdica possuidora de Certificado de Registro Cadastral dever", FONT_PARAGRAPH); Paragraph text2 = new Paragraph(" comunicar ao DPF, no prazo de trinta dias, todo e qualquer " + "fato que justifique a atualizao de seu cadastro", FONT_HEADER); Paragraph text3 = new Paragraph( ", mediante preenchimento de formulrio prprio (Anexo VI). " + SEPARATOR_DOUBLE, FONT_PARAGRAPH); Paragraph text4 = new Paragraph("Pargrafo nico", FONT_HEADER); Paragraph text5 = new Paragraph("O pedido de atualizao do registro cadastral dever ser", FONT_PARAGRAPH);// ww w . j ava2 s . c o m Paragraph text6 = new Paragraph( "formalizado no prazo mximo de noventa dias, a partir da data do comunicado", FONT_HEADER); Paragraph text7 = new Paragraph(" a que se refere o caput, por meio de requerimento (Anexo IV).", FONT_PARAGRAPH); Paragraph paragraphFull = new Paragraph(); paragraphFull.add(artigo); paragraphFull.add(text1); paragraphFull.add(text2); paragraphFull.add(text3); paragraphFull.add(text4); paragraphFull.add(text5); paragraphFull.add(text6); paragraphFull.add(text7); PdfPCell cell = new PdfPCell(paragraphFull); cell.setColspan(4); table.addCell(cell); }
From source file:com.solidmaps.webapp.report.RequerimentAlterLicenseFederalPDF.java
private void insertCell(PdfPTable table, String text, Integer colSpan) { if (text == null) { text = ""; }//from ww w.j av a 2 s. com // create a new cell with the specified Text and Font PdfPCell cell = new PdfPCell(new Phrase(text.trim(), FONT_PARAGRAPH)); // set the cell alignment // in case there is no text and you wan to create an empty row if (text.trim().equalsIgnoreCase("")) { cell.setMinimumHeight(10f); } cell.setHorizontalAlignment(Element.ALIGN_LEFT); cell.setColspan(colSpan); cell.setPadding(5f); // add the call to the table table.addCell(cell); }
From source file:com.solidmaps.webapp.report.RequerimentAlterLicenseFederalPDF.java
private void insertCellProtocol(PdfPTable table, LicensePFEntity license) { PdfPTable tableProtocol = new PdfPTable(1); tableProtocol.setWidthPercentage(100f); Paragraph officialPhrase = new Paragraph("USO OFICIAL" + SEPARATOR, FONT_PARAGRAPH); officialPhrase.setAlignment(Element.ALIGN_LEFT); Paragraph protocolPhrase = new Paragraph("ETIQUETA PROTOCOLO" + SEPARATOR_DOUBLE + SEPARATOR_DOUBLE + SEPARATOR_DOUBLE + SEPARATOR_DOUBLE + SEPARATOR_DOUBLE + SEPARATOR, FONT_PROTOCOL); protocolPhrase.setAlignment(Element.ALIGN_LEFT); Paragraph obsPhrase = new Paragraph("Observao Importante!" + SEPARATOR, FONT_HEADER); Paragraph obsStringPhrase = new Paragraph( "Protocolar este Anexo somente quando no conjugado com a alterao efetiva ou a renovao da licena.", FONT_PARAGRAPH);/* ww w . j a v a2 s . co m*/ Paragraph fullPhrase = new Paragraph(); fullPhrase.add(officialPhrase); fullPhrase.add(protocolPhrase); fullPhrase.add(obsPhrase); fullPhrase.add(obsStringPhrase); PdfPCell cell = new PdfPCell(fullPhrase); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setPadding(5f); tableProtocol.addCell(cell); PdfPCell cellProtocol = new PdfPCell(tableProtocol); cellProtocol.setColspan(2); table.addCell(cellProtocol); table.addCell(this.createCellEtiqueta(license)); }
From source file:com.solidmaps.webapp.report.RequerimentAlterLicenseFederalPDF.java
private PdfPCell createCellEtiqueta(LicensePFEntity license) { PdfPTable tableProtocol = new PdfPTable(3); tableProtocol.setWidthPercentage(100f); this.insertCell(tableProtocol, "LOCAL E DATA" + SEPARATOR_DOUBLE + license.getCompany().getState() + ", " + DateUtils.format(Calendar.getInstance()), 3); this.insertCell(tableProtocol, "REPRESENTANTE LEGAL" + SEPARATOR_DOUBLE + license.getCompany().getUserResponsable().getName(), 3); this.insertCell(tableProtocol, "IDENTIDADE (N - RGO - UF)" + SEPARATOR_DOUBLE + license.getCompany().getUserResponsable().getRg(), 2); this.insertCell(tableProtocol, "CPF" + SEPARATOR_DOUBLE + license.getCompany().getUserResponsable().getCpf(), 1); this.insertCell(tableProtocol, "DDD" + SEPARATOR_DOUBLE + license.getCompany().getUserResponsable().getPhoneDDD(), 1); this.insertCell(tableProtocol, "TELEFONE" + SEPARATOR_DOUBLE + license.getCompany().getUserResponsable().getPhoneNumber(), 1); this.insertCell(tableProtocol, "FAX" + SEPARATOR_DOUBLE + license.getCompany().getUserResponsable().getNumFax(), 1); this.insertCell(tableProtocol, "ASSINATURA" + SEPARATOR_DOUBLE + "________________________________________", 3);/*from w ww . j a v a2 s .c om*/ PdfPCell cell = new PdfPCell(tableProtocol); cell.setColspan(4); return cell; }
From source file:com.solidmaps.webapp.report.RequerimentAlterLicenseFederalPDF.java
private void insertCellAlteracao(PdfPTable table, String text) { if (text == null) { text = ""; }/*from ww w. jav a2 s .co m*/ // create a new cell with the specified Text and Font PdfPCell cell = new PdfPCell(new Phrase(text.trim(), FONT_HEADER)); // set the cell alignment // in case there is no text and you wan to create an empty row if (text.trim().equalsIgnoreCase("")) { cell.setMinimumHeight(10f); } cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(2); cell.setBackgroundColor(BaseColor.LIGHT_GRAY); // add the call to the table table.addCell(cell); }
From source file:com.solidmaps.webapp.report.RequerimentAlterLicenseFederalPDF.java
private void insertCellAlteracaoOption(PdfPTable table, String number, String text, Boolean selected) { String fullText = ""; if (selected) { fullText += number + " |X|" + " " + text; } else {//from www . j ava 2s . c om fullText += number + " | |" + " " + text; } if (StringUtils.isBlank(number) && StringUtils.isBlank(text)) { fullText = ""; } // create a new cell with the specified Text and Font PdfPCell cell = new PdfPCell(new Phrase(fullText.trim(), FONT_PARAGRAPH)); // set the cell alignment // in case there is no text and you wan to create an empty row if (fullText.trim().equalsIgnoreCase("")) { cell.setMinimumHeight(10f); } cell.setHorizontalAlignment(Element.ALIGN_LEFT); cell.setColspan(2); cell.setBorder(Rectangle.RIGHT); cell.setPaddingTop(10f); cell.setPaddingBottom(10f); cell.setPaddingLeft(25f); cell.setPaddingRight(25f); // add the call to the table table.addCell(cell); }
From source file:com.solidmaps.webapp.report.RequerimentAlterLicenseFederalPDF.java
private void insertHeaderCell(PdfPTable table, String text, Integer colSpan) { if (text == null) { text = ""; }/*www .jav a 2s . c o m*/ // create a new cell with the specified Text and Font PdfPCell cell = new PdfPCell(new Phrase(text.trim(), FONT_HEADER)); // set the cell alignment // in case there is no text and you wan to create an empty row if (text.trim().equalsIgnoreCase("")) { cell.setMinimumHeight(10f); } cell.setVerticalAlignment(Element.ALIGN_CENTER); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(colSpan); cell.setBackgroundColor(BaseColor.LIGHT_GRAY); cell.setBorderWidth(2); cell.setPadding(3f); // add the call to the table table.addCell(cell); }
From source file:com.systemevent.jsfclass.util.FormatoPDF.java
/** * Constructor de la clase, inicializa la imagen que se utilizara en el membrete *///from w ww.ja va 2 s . c o m public FormatoPDF(String nombre) { try { PdfPCell celda1 = new PdfPCell(new Phrase("Nombre Cliente")); PdfPCell celda2 = new PdfPCell(new Phrase(nombre)); imagen = Image.getInstance( "C:\\Users\\Jose_Gascon\\Documents\\ProyectoSystemEvent\\sysevent\\src\\main\\webapp\\resources\\imagenes\\logoconstruccion.jpg"); imagen.setAbsolutePosition(30, 720f); imagen.scaleAbsolute(100, 100); celda1.setBorder(Rectangle.BOTTOM); celda2.setBorder(Rectangle.BOTTOM); celda2.setBorder(Rectangle.BOTTOM | Rectangle.RIGHT); table.addCell(celda1); table.addCell(celda2); table.setTotalWidth(350f); } catch (Exception r) { System.err.println("Error al leer la imagen"); } }
From source file:com.systemevent.jsfclass.util.PdfEvento.java
public PdfPTable Tabla_compleja() { //creamos una tabla con 3 columnas PdfPTable mitablacompleja = new PdfPTable(3); //aadimos texto con formato a la primera celda PdfPCell celda = new PdfPCell(new Paragraph("Historial de Observaciones", FontFactory.getFont("arial", // fuente 22, // tamao Font.BOLD, // estilo BaseColor.RED))); // color //unimos esta celda con otras 2 celda.setColspan(3);//from ww w .jav a 2 s .com //alineamos el contenido al centro celda.setHorizontalAlignment(Element.ALIGN_CENTER); // aadimos un espaciado celda.setPadding(12.0f); //colocamos un color de fondo celda.setBackgroundColor(BaseColor.GRAY); //se aade a la tabla mitablacompleja.addCell(celda); //fila 2 celda = new PdfPCell(new Paragraph("AUDITORIA DE SISTEMAS")); celda.setColspan(2); celda.setBackgroundColor(BaseColor.GREEN); mitablacompleja.addCell(celda); celda = new PdfPCell(new Paragraph("Aprobado")); celda.setBackgroundColor(BaseColor.LIGHT_GRAY); mitablacompleja.addCell(celda); //fila 3 celda = new PdfPCell(new Paragraph("COMPILADORES")); celda.setColspan(2); celda.setBackgroundColor(BaseColor.YELLOW); mitablacompleja.addCell(celda); celda = new PdfPCell(new Paragraph("Reprobado")); celda.setBackgroundColor(BaseColor.LIGHT_GRAY); mitablacompleja.addCell(celda); //fila 4 celda = new PdfPCell(new Paragraph("Prog. Bajo Nivel")); celda.setColspan(2); celda.setBackgroundColor(BaseColor.CYAN); mitablacompleja.addCell(celda); celda = new PdfPCell(new Paragraph("Eximido")); celda.setBackgroundColor(BaseColor.LIGHT_GRAY); mitablacompleja.addCell(celda); //fila 5 mitablacompleja.addCell("Conclusion"); celda = new PdfPCell(new Paragraph("GET A LIFE!!!")); celda.setHorizontalAlignment(Element.ALIGN_RIGHT); celda.setColspan(2); celda.setBackgroundColor(BaseColor.ORANGE); mitablacompleja.addCell(celda); // se retorna la tabla return mitablacompleja; }