List of usage examples for com.itextpdf.text.pdf PdfPTable getDefaultCell
public PdfPCell getDefaultCell()
PdfPCell
that will be used as reference for all the addCell
methods except addCell(PdfPCell)
. From source file:edu.avans.ivh5.shared.util.generateInvoicePDF.java
private static void createTable(Section preface) throws BadElementException { PdfPTable table = new PdfPTable(2); table.getDefaultCell().setBorder(PdfPCell.NO_BORDER); table.addCell("Naam klant"); table.addCell("Naam bedrijf"); table.addCell("Adres Klant"); table.addCell("Adres Bedrijf"); table.addCell("Postcode + Plaats klant "); table.addCell("Postcode + Plaats klant"); table.addCell(""); table.addCell("telefoonnummer bedrijf"); table.addCell(""); table.addCell("Bankgegevens bedrijf"); table.addCell(""); table.addCell("BTW-nummer bedrijf"); table.addCell(" "); table.addCell(" "); table.addCell(" "); table.addCell(" "); preface.add(table);// ww w.j a v a 2s . c om }
From source file:edu.avans.ivh5.shared.util.generateInvoicePDF.java
private static void createTable2(Section preface) throws BadElementException { PdfPTable table = new PdfPTable(1); table.getDefaultCell().setBorder(PdfPCell.NO_BORDER); table.addCell("Factuur nummer"); table.addCell("Factuuratum"); table.addCell("Vervaldatum"); table.addCell(" "); table.addCell(" "); table.addCell(" "); table.addCell(" "); preface.add(table);//from w w w .j av a 2 s. co m }
From source file:edu.avans.ivh5.shared.util.generateInvoicePDF.java
private static void createTable3(Section preface) throws BadElementException { PdfPTable table = new PdfPTable(4); table.getDefaultCell().setBorder(PdfPCell.NO_BORDER); table.addCell("Behandelcode"); table.addCell("Aantal sessies"); table.addCell("Prijs per sessie"); table.addCell("Totaal"); table.addCell("AAA01CS"); table.addCell("2"); table.addCell(" 30"); table.addCell(" 60"); table.addCell(" "); table.addCell(" "); table.addCell(" "); table.addCell(" "); table.addCell(" "); table.addCell(" "); table.addCell(" "); table.addCell(" "); preface.add(table);//from w w w .ja v a 2 s . c o m }
From source file:edu.avans.ivh5.shared.util.generateInvoicePDF.java
private static void createTable4(Section preface) throws BadElementException { PdfPTable table = new PdfPTable(2); //PdfPCell cell = new PdfPCell(new Paragraph("header with colspan 3")); table.getDefaultCell().setBorder(PdfPCell.NO_BORDER); //cell.setColspan(3); // table.addCell(cell); table.addCell("Eigenrisco"); table.addCell("Te betalen"); table.addCell(" 140"); table.addCell(" 0"); table.addCell(" "); table.addCell(" "); table.addCell(" "); table.addCell(" "); table.addCell(" "); table.addCell(" "); table.addCell(" "); table.addCell(" "); preface.add(table);//from www .jav a 2s. c om }
From source file:edu.avans.ivh5.shared.util.generateInvoicePDF.java
private static void createTable5(Section preface) throws BadElementException { PdfPTable table = new PdfPTable(1); table.getDefaultCell().setBorder(PdfPCell.NO_BORDER); table.addCell("Gelieve te betalen binnen 30 dagen"); table.addCell(" "); table.addCell(" "); preface.add(table);/* w w w .j ava 2 s. c o m*/ }
From source file:edu.cornell.mannlib.vitro.webapp.visualization.visutils.PDFDocument.java
License:Open Source License
private PdfPTable createTable(Map<String, Integer> yearToPublicationCount) { Font normalContentStyle = FontFactory.getFont(FontFactory.TIMES_ROMAN, 11); Font summaryContentStyle = FontFactory.getFont(FontFactory.TIMES_ROMAN, 11, Font.BOLDITALIC); BaseColor summaryBackgroundColor = new BaseColor(0xEE, 0xEE, 0xEE); BaseColor headerBackgroundColor = new BaseColor(0xC3, 0xD9, 0xFF); BaseColor bodyBackgroundColor = new BaseColor(Color.white); PdfPTable table = new PdfPTable(2); table.setWidthPercentage(36.0f);//from w w w .j av a2 s .c o m table.setHorizontalAlignment(Element.ALIGN_LEFT); table.getDefaultCell().setBorderWidth(0.0f); table.setHeaderRows(2); PdfPCell cell; cell = new PdfPCell(new Phrase("Publications per year", normalContentStyle)); setTableCaptionStyle(summaryBackgroundColor, cell); table.addCell(cell); cell = new PdfPCell(new Phrase("Year", normalContentStyle)); setTableHeaderStyle(headerBackgroundColor, cell); table.addCell(cell); cell.setPhrase(new Phrase("Publications", normalContentStyle)); table.addCell(cell); setTableBodyStyle(bodyBackgroundColor, cell); int totalPublications = 0; for (Entry<String, Integer> currentEntry : yearToPublicationCount.entrySet()) { cell.setPhrase(new Phrase(currentEntry.getKey(), normalContentStyle)); table.addCell(cell); cell.setPhrase(new Phrase(currentEntry.getValue().toString(), normalContentStyle)); table.addCell(cell); totalPublications += currentEntry.getValue(); } setTableFooterStyle(summaryBackgroundColor, cell); cell.setPhrase(new Phrase("Total", summaryContentStyle)); table.addCell(cell); cell.setPhrase(new Phrase(String.valueOf(totalPublications), summaryContentStyle)); table.addCell(cell); return table; }
From source file:edu.uc.modulocontable.general.GenerarFacturaComprasPDF.java
private void cabezera(CabeceraFacturac c) throws DocumentException { PdfPTable tablePanelInicial = new PdfPTable(2); tablePanelInicial.setWidthPercentage(100); tablePanelInicial.getDefaultCell().setBorder(0); PdfPTable tablePanelIzquierdo = new PdfPTable(1); tablePanelIzquierdo.setWidthPercentage(100); tablePanelIzquierdo.getDefaultCell().setBorder(0); PdfPTable tablePanelDerecho = new PdfPTable(1); tablePanelDerecho.setWidthPercentage(100); tablePanelDerecho.getDefaultCell().setBorder(0); imagen.setDir("/Users/cuent/Downloads/abc-logo.jpg"); tablePanelIzquierdo.addCell(imagen.getImage()); titulo1.setTexto(c.getEstablecimiento()); tablePanelIzquierdo.addCell(titulo1.getElemento()); tablePanelInicial.addCell(tablePanelIzquierdo); titulo2.setTexto("RUC: " + c.getCodigoProveedor().getIdentificacion()); tablePanelDerecho.addCell(titulo2.getElemento()); tablePanelDerecho.addCell(espacioBlanco.getElemento()); titulo2.setTexto("FACTURA"); titulo2.getElementoRojo();/* w ww. j av a 2 s .c o m*/ tablePanelDerecho.addCell(titulo2.getElemento()); titulo2.setTexto("No.: " + c.getAutorizacionSri().getEstablecimiento() + "-" + c.getAutorizacionSri().getPtoEmision() + "-" + c.getNumeroFactura()); titulo2.getElementoRojo(); tablePanelDerecho.addCell(titulo2.getElemento()); tablePanelDerecho.addCell(espacioBlanco.getElemento()); tablaVertical.limpiar(1); int[] tamanos2 = { 50 }; int[] alineamientos = { 0, 0 }; tablaVertical.setTamanos(tamanos2); tablaVertical.setTitulos("Nmero de Autorizacin:"); Object[] datos10 = { c.getAutorizacionSri().getNumeroAutorizacion() }; tablaVertical.setContenidos(datos10); tablaVertical.setAlineamientos(alineamientos); tablaVertical.llenarTabla(false); tablaVertical.setPosicion(0); tablaVertical.setAnchoTabla(65); tablePanelDerecho.addCell(tablaVertical.getTabla()); tablePanelDerecho.addCell(espacioBlanco.getElemento()); tablaVertical.limpiar(); Object[] datos3 = { c.getFecha().toString(), ambiente, emision }; tablaVertical.setTitulos("Fecha y Hora de Autorizacin: ", "Ambiente:", "Emision:"); tablaVertical.setContenidos(datos3); tablaVertical.llenarTabla(false); tablaVertical.setPosicion(0); tablaVertical.setAnchoTabla(65); tablePanelDerecho.addCell(tablaVertical.getTabla()); tablePanelDerecho.addCell(espacioBlanco.getElemento()); tablePanelDerecho.addCell(espacioBlanco.getElemento()); tablePanelDerecho.addCell(espacioBlanco.getElemento()); tablePanelInicial.addCell(tablePanelDerecho); documento.add(tablePanelInicial); }
From source file:edu.uc.modulocontable.general.GenerarFacturaVentasPDF.java
private void cabezera(CabeceraFacturav c) throws DocumentException { Archivo a = new Archivo(); Empresa empresa = a.obtieneContenidoArchivo().get(0); PdfPTable tablePanelInicial = new PdfPTable(2); tablePanelInicial.setWidthPercentage(100); tablePanelInicial.getDefaultCell().setBorder(0); PdfPTable tablePanelIzquierdo = new PdfPTable(1); tablePanelIzquierdo.setWidthPercentage(100); tablePanelIzquierdo.getDefaultCell().setBorder(0); PdfPTable tablePanelDerecho = new PdfPTable(1); tablePanelDerecho.setWidthPercentage(100); tablePanelDerecho.getDefaultCell().setBorder(0); imagen.setDir("/Users/cuent/Downloads/abc-logo.jpg"); tablePanelIzquierdo.addCell(imagen.getImage()); titulo1.setTexto(empresa.getNombre()); tablePanelIzquierdo.addCell(titulo1.getElemento()); // tablaVertical.limpiar(); // tablaVertical.setTitulos("Dir. Matriz:", "Dir. Sucursal:"); // Object[] datos1 = { bus.getInfoTributaria().getDirMatriz(), bus.getInfoFactura().getDirEstablecimiento() }; // tablaVertical.setContenidos(datos1); // tablaVertical.setAlineamientos(new int[] { 0, 0 }); // tablaVertical.llenarTabla(false); // tablaVertical.setPosicion(2); // tablaVertical.setTamanos(new int[] { 25, 75 }); // tablaVertical.setAnchoTabla(100); // tablePanelIzquierdo.addCell(tablaVertical.getTabla()); // tablaVertical.limpiar(); // tablaVertical.setTitulos("Contribuyente Especial Nro.:", "Obligado a llever contabilidad:"); // Object[] datos2 = { // bus.getInfoFactura().getContribuyenteEspecial(), bus.getInfoFactura().getObligadoContabilidad() }; // tablaVertical.setContenidos(datos2); // tablaVertical.setAlineamientos(new int[] { 0, 0 }); // tablaVertical.llenarTabla(false); // tablaVertical.setPosicion(2); // tablaVertical.setTamanos(new int[] { 60, 40 }); // tablaVertical.setAnchoTabla(100); // tablePanelIzquierdo.addCell(tablaVertical.getTabla()); tablePanelInicial.addCell(tablePanelIzquierdo); titulo2.setTexto("RUC: " + empresa.getRuc()); tablePanelDerecho.addCell(titulo2.getElemento()); tablePanelDerecho.addCell(espacioBlanco.getElemento()); titulo2.setTexto("FACTURA"); titulo2.getElementoRojo();//from w ww .j a v a2 s . com tablePanelDerecho.addCell(titulo2.getElemento()); titulo2.setTexto("No.: " + c.getEstablecimiento() + "-" + c.getPtoEmision() + "-" + c.getNumeroFactura()); titulo2.getElementoRojo(); tablePanelDerecho.addCell(titulo2.getElemento()); tablePanelDerecho.addCell(espacioBlanco.getElemento()); tablaVertical.limpiar(1); int[] tamanos2 = { 50 }; int[] alineamientos = { 0, 0 }; tablaVertical.setTamanos(tamanos2); tablaVertical.setTitulos("Nmero de Autorizacin:"); Object[] datos10 = { c.getAutorizacionSri().getNumeroAutorizacion() }; tablaVertical.setContenidos(datos10); tablaVertical.setAlineamientos(alineamientos); tablaVertical.llenarTabla(false); tablaVertical.setPosicion(0); tablaVertical.setAnchoTabla(65); tablePanelDerecho.addCell(tablaVertical.getTabla()); tablePanelDerecho.addCell(espacioBlanco.getElemento()); tablaVertical.limpiar(); Object[] datos3 = { empresa.getDireccion(), empresa.getTelefono(), c.getFecha().toString(), ambiente, emision }; tablaVertical.setTitulos("Direccin:", "Tlefono:", "Fecha y Hora de Autorizacin:", "Ambiente:", "Emision:"); tablaVertical.setContenidos(datos3); tablaVertical.llenarTabla(false); tablaVertical.setPosicion(0); tablaVertical.setAnchoTabla(65); tablePanelDerecho.addCell(tablaVertical.getTabla()); tablePanelDerecho.addCell(espacioBlanco.getElemento()); tablePanelDerecho.addCell(espacioBlanco.getElemento()); // titulo3.setTexto("Clave de Acceso:"); // titulo3.getElementoNegro(); // tablePanelDerecho.addCell(titulo3.getElemento()); tablePanelDerecho.addCell(espacioBlanco.getElemento()); // codigoBarra.setTexto(getClaveAcceso()); // tablePanelDerecho.addCell(codigoBarra.getCodigoBarra(documento.getContentbyte())); tablePanelInicial.addCell(tablePanelDerecho); documento.add(tablePanelInicial); }
From source file:edu.uc.modulocontable.general.GenerarKardexPDF.java
private void cabecera(Producto producto) throws DocumentException { Archivo a = new Archivo(); Empresa empresa = a.obtieneContenidoArchivo().get(0); PdfPTable tablePanelInicial = new PdfPTable(2); tablePanelInicial.setWidthPercentage(100); tablePanelInicial.getDefaultCell().setBorder(0); PdfPTable tablePanelIzquierdo = new PdfPTable(1); tablePanelIzquierdo.setWidthPercentage(50); tablePanelIzquierdo.getDefaultCell().setBorder(0); PdfPTable tablePanelDerecho = new PdfPTable(1); tablePanelDerecho.setWidthPercentage(100); tablePanelDerecho.getDefaultCell().setBorder(0); titulo1.setTexto(empresa.getNombre()); tablePanelIzquierdo.addCell(titulo1.getElemento()); imagen.setDir("/Users/cuent/Downloads/abc-log.jpg"); tablePanelIzquierdo.addCell(imagen.getImage()); tablePanelInicial.addCell(tablePanelIzquierdo); tablePanelDerecho.addCell(espacioBlanco.getElemento()); titulo2.setTexto("KARDEX LIFO"); titulo2.getElementoRojo();// ww w .j a v a 2 s . com tablePanelDerecho.addCell(titulo2.getElemento()); tablePanelDerecho.addCell(espacioBlanco.getElemento()); tablaVertical.limpiar(); int[] alineamientos = { 0, 0, 0 }; Object[] datos = { producto.getCodigoProducto(), producto.getNombre(), producto.getStock() }; tablaVertical.setTitulos("Codigo", "Producto:", "Stock:"); tablaVertical.setContenidos(datos); tablaVertical.setAlineamientos(alineamientos); tablaVertical.llenarTabla(false); tablaVertical.setPosicion(0); tablaVertical.setAnchoTabla(65); tablePanelDerecho.addCell(tablaVertical.getTabla()); tablePanelDerecho.addCell(espacioBlanco.getElemento()); tablePanelInicial.addCell(tablePanelDerecho); documento.add(tablePanelInicial); }
From source file:edu.uc.modulocontable.general.GenerarKardexPDF.java
private void totalDetalleDocumento() throws DocumentException { PdfPTable tablePanelInicial = new PdfPTable(11); tablePanelInicial.setWidthPercentage(100); tablePanelInicial.getDefaultCell().setBorder(0); titulo4.setTexto(""); tablePanelInicial.addCell(titulo4.getElemento()); titulo4.setTexto(""); tablePanelInicial.addCell(titulo4.getElemento()); titulo4.setTexto(""); tablePanelInicial.addCell(titulo4.getElemento()); PdfPCell cell = new PdfPCell(new Paragraph("Total", FontFactory.getFont("arial", 9, Font.BOLD))); cell.setHorizontalAlignment(1);// ww w . j a va 2s . c om cell.setBorder(0); tablePanelInicial.addCell(cell); cell = new PdfPCell( new Paragraph(String.valueOf(getCantidadEntrada()), FontFactory.getFont("arial", 8, Font.BOLD))); cell.setHorizontalAlignment(1); cell.setBorder(0); tablePanelInicial.addCell(cell); titulo4.setTexto(""); tablePanelInicial.addCell(titulo4.getElemento()); cell = new PdfPCell( new Paragraph(String.valueOf(getCantidadSalida()), FontFactory.getFont("arial", 8, Font.BOLD))); cell.setHorizontalAlignment(2); cell.setBorder(0); tablePanelInicial.addCell(cell); titulo4.setTexto(""); tablePanelInicial.addCell(titulo4.getElemento()); titulo4.setTexto(""); tablePanelInicial.addCell(titulo4.getElemento()); titulo4.setTexto(String.valueOf(getSaldoCantidad())); tablePanelInicial.addCell(titulo4.getElemento()); cell = new PdfPCell( new Paragraph("$ " + String.valueOf(getSaldoTotal()), FontFactory.getFont("arial", 8, Font.BOLD))); cell.setHorizontalAlignment(1); cell.setBorder(0); tablePanelInicial.addCell(cell); documento.add(tablePanelInicial); documento.add(espacioBlanco.getElemento()); documento.add(lineaNormal.getLinea()); }