List of usage examples for com.itextpdf.text.pdf PdfPCell PdfPCell
public PdfPCell(PdfPCell cell)
PdfPCell
. From source file:com.mycom.products.mywebsite.backend.util.DownloadHandler.java
License:Open Source License
private void setTableHeader(String value, PdfPTable table) { PdfPCell cell = new PdfPCell(new Paragraph(value)); cell.setBorderColor(BaseColor.GRAY); cell.setFixedHeight(25);/* w w w . ja v a2 s.co m*/ BaseColor myColor = WebColors.getRGBColor("#F7F7F7"); cell.setBackgroundColor(myColor); cell.setPaddingLeft(10); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); table.addCell(cell); }
From source file:com.mycom.products.mywebsite.backend.util.DownloadHandler.java
License:Open Source License
private void setTableContent(String value, PdfPTable table) { PdfPCell cell = new PdfPCell(new Paragraph(value)); cell.setBorderColor(BaseColor.GRAY); cell.setPaddingLeft(10);/*from ww w . j av a 2 s.c o m*/ cell.setHorizontalAlignment(Element.ALIGN_LEFT); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); table.addCell(cell); }
From source file:com.mycompany.mavenproject2.VirtualkeyController.java
private static void createTable(/*Section subCatPart*/String tableName, Paragraph preface) throws BadElementException { try {/*w w w. j a va 2 s . co m*/ ArrayList<String> list = new ArrayList<String>(); // t.setBorderColor(BaseColor.GRAY); // t.setPadding(4); // t.setSpacing(4); // t.setBorderWidth(1); int length = 0; java.sql.Connection conn = Connection.getConnect(); Statement st = conn.createStatement(); st = conn.createStatement(); ResultSet rs = st.executeQuery("SELECT * FROM " + tableName); ResultSetMetaData rsMetaData = rs.getMetaData(); int numberOfColumns = rsMetaData.getColumnCount(); System.out.println("resultSet MetaData column Count=" + numberOfColumns); for (int i = 1; i <= numberOfColumns; i++) { length = i; } MongoClient client = new MongoClient(); MongoDatabase db = client.getDatabase("FinalDemo"); PdfPTable table = new PdfPTable(length); for (int i = 1; i <= numberOfColumns; i++) { // System.out.println("column MetaData "); //System.out.println("column number " + i); // get the column's name. System.out.println(rsMetaData.getColumnName(i)); PdfPCell c1 = new PdfPCell(new Phrase(rsMetaData.getColumnName(i))); c1.setHorizontalAlignment(Element.ALIGN_CENTER); list.add(rsMetaData.getColumnName(i)); table.addCell(c1); } while (rs.next()) { for (String col : list) { //System.out.println("Column name is "+col+"value is "+rs.getString(col)); table.addCell(rs.getString(col)); } } /*PdfPCell c1 = new PdfPCell(new Phrase("Table Header 1")); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase("Table Header 2")); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase("Table Header 3")); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1);*/ table.setHeaderRows(1); preface.add(table); //subCatPart.add(table); } catch (ClassNotFoundException ex) { Logger.getLogger(VirtualkeyController.class.getName()).log(Level.SEVERE, null, ex); } catch (SQLException ex) { Logger.getLogger(VirtualkeyController.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:com.nerdcastle.nazmul.filetest.MainActivity.java
private static void createTable(Section subCatPart) throws BadElementException { ArrayList<String> a = new ArrayList<>(); a.add("1");// www .j a v a 2 s.co m a.add("2"); a.add("3"); ArrayList<String> b = new ArrayList<>(); b.add("4"); b.add("5"); b.add("6"); ArrayList<String> c = new ArrayList<>(); c.add("7"); c.add("8"); c.add("9"); PdfPTable table = new PdfPTable(3); // t.setBorderColor(BaseColor.GRAY); // t.setPadding(4); // t.setSpacing(4); // t.setBorderWidth(1); PdfPCell c1 = new PdfPCell(new Phrase("Table Header 1")); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase("Table Header 2")); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); c1 = new PdfPCell(new Phrase("Table Header 3")); c1.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(c1); table.setHeaderRows(1); for (int i = 0; i < a.size(); i++) { table.addCell(a.get(i)); table.addCell(b.get(i)); table.addCell(c.get(i)); } /* table.addCell("1.0"); table.addCell("1.1"); table.addCell("1.2"); table.addCell("2.1"); table.addCell("2.2"); table.addCell("2.3");*/ subCatPart.add(table); }
From source file:com.norbsoft.pdfconverter.helpers.PDFHelper.java
License:Open Source License
private PdfPTable table(Form form) { int cellPadding = 5; PdfPTable table = new PdfPTable(8); table.setSpacingBefore(20);/*from w w w . ja v a 2 s . c o m*/ try { table.setWidths(new int[] { 100, 120, 30, 60, 60, 50, 50, 50 }); } catch (DocumentException e) { Log.e(TAG, "Width error:" + e.getMessage()); } PdfPCell cell = new PdfPCell(new Paragraph("Adres: " + form.getAddress(), normal)); cell.setColspan(8); cell.setPadding(cellPadding); cell.setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.TOP); cell.setBorderColorBottom(BaseColor.BLACK); table.addCell(cell); cell = new PdfPCell(new Paragraph("Odbiorca: " + form.getOwner(), normal)); cell.setColspan(8); cell.setPadding(cellPadding); cell.setBorder(Rectangle.LEFT | Rectangle.RIGHT); cell.setBorderColorBottom(BaseColor.BLACK); table.addCell(cell); cell = new PdfPCell(new Paragraph("Data: " + form.getDate(), normal)); cell.setColspan(3); cell.setPadding(cellPadding); cell.setBorder(Rectangle.LEFT | Rectangle.BOTTOM); cell.setBorderColorBottom(BaseColor.BLACK); table.addCell(cell); cell = new PdfPCell(new Paragraph("tel: " + form.getPhone(), normal)); cell.setColspan(5); cell.setPadding(cellPadding); cell.setBorder(Rectangle.RIGHT | Rectangle.BOTTOM); cell.setBorderColorBottom(BaseColor.BLACK); table.addCell(cell); //Header Paragraph p = new Paragraph("WODOMIERZ", bold); cell = new PdfPCell(p); cell.setPadding(cellPadding); cell.setNoWrap(true); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); table.addCell(cell); p = new Paragraph("Nr fabryczny", bold); cell = new PdfPCell(p); cell.setPadding(cellPadding); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); table.addCell(cell); p = new Paragraph("DN", bold); cell = new PdfPCell(p); cell.setPadding(cellPadding); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); table.addCell(cell); p = new Paragraph("Typ\r\nProducent", bold); cell = new PdfPCell(p); cell.setPadding(cellPadding); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); table.addCell(cell); p = new Paragraph("Stan w (m3)", bold); cell = new PdfPCell(p); cell.setPadding(cellPadding); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); table.addCell(cell); p = new Paragraph("Rok\r\nlegalizacji", bold); cell = new PdfPCell(p); ; cell.setPadding(cellPadding); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); table.addCell(cell); p = new Paragraph("Czy plomba\r\nlegalizacyjna jest\r\nuszkodzona?", bold); cell = new PdfPCell(p); cell.setPadding(cellPadding); cell.setColspan(2); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); table.addCell(cell); //First row cell = new PdfPCell(new Paragraph("Zamontowany", bold)); cell.setNoWrap(true); cell.setPadding(cellPadding); table.addCell(cell); p = new Paragraph(form.getNewSN(), normal); cell = new PdfPCell(p); cell.setPadding(cellPadding); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); table.addCell(cell); p = new Paragraph(form.getNewDN(), normal); cell = new PdfPCell(p); cell.setPadding(cellPadding); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); table.addCell(cell); p = new Paragraph(form.getNewType() + "\r\n" + form.getNewManufacturer(), normal); cell = new PdfPCell(p); cell.setPadding(cellPadding); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); table.addCell(cell); p = new Paragraph(form.getNewState(), normal); cell = new PdfPCell(p); cell.setPadding(cellPadding); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); table.addCell(cell); p = new Paragraph(form.getNewYear(), normal); cell = new PdfPCell(p); cell.setPadding(cellPadding); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); table.addCell(cell); if (form.getNewSeal().equals("Tak")) p = new Paragraph("tak", normal); else p = new Paragraph("tak", strike); cell = new PdfPCell(p); cell.setPadding(cellPadding); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); table.addCell(cell); if (form.getNewSeal().equals("Nie")) p = new Paragraph("nie", normal); else p = new Paragraph("nie", strike); cell = new PdfPCell(p); cell.setPadding(cellPadding); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); table.addCell(cell); //Second row cell = new PdfPCell(new Paragraph("Wymontowany", bold)); cell.setNoWrap(true); cell.setPadding(cellPadding); table.addCell(cell); p = new Paragraph(form.getOldSN(), normal); cell = new PdfPCell(p); cell.setPadding(cellPadding); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); table.addCell(cell); p = new Paragraph(form.getOldDN(), normal); cell = new PdfPCell(p); cell.setPadding(cellPadding); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); table.addCell(cell); p = new Paragraph(form.getOldType() + "\r\n" + form.getOldManufacturer(), normal); cell = new PdfPCell(p); cell.setPadding(cellPadding); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); table.addCell(cell); p = new Paragraph(form.getOldState(), normal); cell = new PdfPCell(p); cell.setPadding(cellPadding); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); table.addCell(cell); p = new Paragraph(form.getOldYear(), normal); cell = new PdfPCell(p); cell.setPadding(cellPadding); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); table.addCell(cell); if (form.getOldSeal().equals("Tak")) p = new Paragraph("tak", normal); else p = new Paragraph("tak", strike); cell = new PdfPCell(p); cell.setPadding(cellPadding); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); table.addCell(cell); if (form.getOldSeal().equals("Nie")) p = new Paragraph("nie", normal); else p = new Paragraph("nie", strike); cell = new PdfPCell(p); cell.setPadding(cellPadding); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); table.addCell(cell); //Third row cell = new PdfPCell(new Paragraph("Plomba nr 1", bold)); cell.setPadding(cellPadding); table.addCell(cell); p = new Paragraph(form.getSealFirst(), normal); cell = new PdfPCell(p); cell.setPadding(cellPadding); cell.setColspan(2); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); table.addCell(cell); cell = new PdfPCell(new Paragraph("Przyczyna wymiany: " + form.getReason(), normal)); cell.setPadding(cellPadding); cell.setColspan(5); table.addCell(cell); //Fourth row cell = new PdfPCell(new Paragraph("Plomba nr 2", bold)); cell.setPadding(cellPadding); table.addCell(cell); p = new Paragraph(form.getSealSecond(), normal); cell = new PdfPCell(p); cell.setPadding(cellPadding); cell.setColspan(2); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); table.addCell(cell); cell = new PdfPCell(new Paragraph("Umiejscowienie wodomierza: " + form.getPlacement(), normal)); cell.setPadding(cellPadding); cell.setColspan(5); table.addCell(cell); //Fourth row cell = new PdfPCell(new Paragraph("Nr moduu\r\nradiowego", bold)); cell.setPadding(cellPadding); table.addCell(cell); cell = new PdfPCell(new Paragraph(form.getNewModuleNumber(), normal)); cell.setPadding(cellPadding); cell.setColspan(7); cell.setVerticalAlignment(Element.ALIGN_MIDDLE); table.addCell(cell); table.setWidthPercentage(100); return table; }
From source file:com.norbsoft.pdfconverter.helpers.PDFHelper.java
License:Open Source License
private PdfPTable signTable(Form form, Image sgn, ArrayList<String> workers) { int cellPadding = 5; PdfPTable table = new PdfPTable(2); table.setSpacingBefore(15);/*w w w.j ava 2 s.c o m*/ PdfPCell cell = new PdfPCell(new Paragraph("Data i podpis klienta: ", normal)); cell.setPadding(cellPadding); cell.setBorder(0); table.addCell(cell); cell = new PdfPCell(new Paragraph("Wykonali pracownicy: ", normal)); cell.setPadding(cellPadding); cell.setBorder(0); table.addCell(cell); cell = new PdfPCell(sgn); cell.setRowspan(workers.size()); cell.setPadding(cellPadding); cell.setBorder(0); table.addCell(cell); for (int i = 0; i < workers.size(); i++) { cell = new PdfPCell(new Paragraph(workers.get(i), normal)); cell.setPadding(cellPadding); cell.setBorder(0); table.addCell(cell); } table.setWidthPercentage(90); return table; }
From source file:com.northcoders.controller.BookingReportsController.java
@FXML private void generatePdf() throws Exception { BaseFont bf;// w ww . j a va 2 s .c o m Font font; try { conditions = "Filtered by: Start Date:2017-03-15 End Date:2017-03-28"; /* Step-2: Initialize PDF documents - logical objects */ Document my_pdf_report = new Document(PageSize.LETTER.rotate()); PdfWriter.getInstance(my_pdf_report, new FileOutputStream("pdf_booking_report.pdf")); my_pdf_report.open(); //we have four columns in our table PdfPTable my_report_table = new PdfPTable(6); //create a cell object PdfPCell table_cell; bf = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.EMBEDDED); font = new Font(bf, 16); my_pdf_report.add(new Paragraph("Administration Report", font)); font = new Font(bf, 12); my_pdf_report.add(new Paragraph("Filter applied:" + conditions, font)); my_pdf_report.add(new Paragraph(" ")); table_cell = new PdfPCell(new Phrase("Customer")); my_report_table.addCell(table_cell); table_cell = new PdfPCell(new Phrase("Start Date")); my_report_table.addCell(table_cell); table_cell = new PdfPCell(new Phrase("End Date")); my_report_table.addCell(table_cell); table_cell = new PdfPCell(new Phrase("Room")); my_report_table.addCell(table_cell); table_cell = new PdfPCell(new Phrase("Amount")); my_report_table.addCell(table_cell); table_cell = new PdfPCell(new Phrase("Transactions")); my_report_table.addCell(table_cell); for (Booking item : bookings) { String customer_b = item.getCustomerId().getId() + " " + item.getCustomerId().getFirstName() + " " + item.getCustomerId().getLastName(); table_cell = new PdfPCell(new Phrase(customer_b)); my_report_table.addCell(table_cell); String date_start_b = dateToStr(item.getStartDate()); table_cell = new PdfPCell(new Phrase(date_start_b)); my_report_table.addCell(table_cell); String date_end_b = dateToStr(item.getEndDate()); table_cell = new PdfPCell(new Phrase(date_end_b)); my_report_table.addCell(table_cell); String room_b = String.valueOf(item.getRoomId().getRoomNumber()); table_cell = new PdfPCell(new Phrase(room_b)); my_report_table.addCell(table_cell); String price_b = String.format("%1$,.2f", item.getTotalPrice()); table_cell = new PdfPCell(new Phrase(price_b)); my_report_table.addCell(table_cell); String transaction_b = ""; for (PaymentTransaction trans : item.getPaymentTransactionList()) { transaction_b += String.format("%1$,.2f", trans.getAmount()) + " " + trans.getPaymentTypeId().getDescription() + "\n"; } table_cell = new PdfPCell(new Phrase(transaction_b)); my_report_table.addCell(table_cell); } /* Attach report table to PDF */ my_pdf_report.add(my_report_table); my_pdf_report.add(new Paragraph(" ")); font = new Font(bf, 6); my_pdf_report.add(new Paragraph("Report Time:" + dateTimeToStr(new Date()))); my_pdf_report.close(); } catch (DocumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
From source file:com.pdf.GetPdf.java
public static void addXls(Document document, String url, String type) throws IOException, DocumentException { Iterator<Row> rowIterator; int colNo;/* w w w . j a v a 2s .c om*/ if (type.equals("xls")) { HSSFWorkbook excelWorkbook = new HSSFWorkbook(new URL(url).openStream()); HSSFSheet my_worksheet = excelWorkbook.getSheetAt(0); rowIterator = my_worksheet.iterator(); colNo = my_worksheet.getRow(0).getLastCellNum(); } else { XSSFWorkbook excelWorkbook1 = new XSSFWorkbook(new URL(url).openStream()); XSSFSheet my_worksheet = excelWorkbook1.getSheetAt(0); rowIterator = my_worksheet.iterator(); colNo = my_worksheet.getRow(0).getLastCellNum(); } PdfPTable my_table = new PdfPTable(colNo); PdfPCell table_cell = null; while (rowIterator.hasNext()) { Row row = rowIterator.next(); //Read Rows from Excel document Iterator<Cell> cellIterator = row.cellIterator();//Read every column for every row that is READ while (cellIterator.hasNext()) { Cell cell = cellIterator.next(); //Fetch CELL if (cell.getCellType() == (Cell.CELL_TYPE_NUMERIC)) { table_cell = new PdfPCell(new Phrase(new Double(cell.getNumericCellValue()).toString())); System.out.println(cell.getNumericCellValue()); my_table.addCell(table_cell); } else if (cell.getCellType() == (Cell.CELL_TYPE_STRING)) { table_cell = new PdfPCell(new Phrase(cell.getStringCellValue())); System.out.println(cell.getStringCellValue()); my_table.addCell(table_cell); } else if (cell.getCellType() == (Cell.CELL_TYPE_FORMULA)) { table_cell = new PdfPCell(new Phrase(cell.getCellFormula())); my_table.addCell(table_cell); } else if (cell.getCellType() == (Cell.CELL_TYPE_BLANK)) { table_cell = new PdfPCell(new Phrase("")); my_table.addCell(table_cell); } else { table_cell = new PdfPCell(new Phrase("")); my_table.addCell(table_cell); } } } document.add(my_table); }
From source file:com.pdfs.GeneradorVisitas.java
public void addCreditosExpress(DatosVisitaDomiciliaria credito) throws DocumentException { documento.add(foto);//from w ww . ja va 2 s .c o m Paragraph p = new Paragraph("BUFETE DEL RIO, S.C.", tituloN1); p.setAlignment(Chunk.ALIGN_CENTER); documento.add(p); p = new Paragraph("La Firma Marca la Diferencia ", tituloN2); p.setAlignment(Chunk.ALIGN_CENTER); documento.add(p); p = new Paragraph("Balboa 1111, Portales Sur, 03300, Mxico, D.F.", tituloN3); p.setAlignment(Chunk.ALIGN_CENTER); documento.add(p); p = new Paragraph("(55) 5539 0104 con 10 Lneas contacto@corporativodelrio.com", tituloN3); p.setAlignment(Chunk.ALIGN_CENTER); documento.add(p); PdfPTable datos = new PdfPTable(2); datos.setWidthPercentage(90); Phrase pnombre = new Phrase(credito.getNombre()); pnombre.setFont(cuerpo2); Phrase pcalle = new Phrase(credito.getCalle()); pcalle.setFont(cuerpo2); Phrase pnumcredito = new Phrase(credito.getNumcredito()); pnumcredito.setFont(cuerpo2); Phrase pcolonia = new Phrase(credito.getColonia()); pcolonia.setFont(cuerpo2); Phrase pdelegacion = new Phrase(credito.getDelegacion()); pdelegacion.setFont(cuerpo2); float sdo = credito.getSaldo(); Phrase psaldo = new Paragraph(nf.format(sdo)); psaldo.setFont(cuerpo2); Phrase pestadpCp = new Phrase(credito.getEstado() + " " + credito.getCp()); pestadpCp.setFont(cuerpo2); PdfPCell nombre = new PdfPCell(pnombre); PdfPCell titulocred = new PdfPCell(new Phrase("N Crdito")); PdfPCell calle = new PdfPCell(pcalle); PdfPCell numcredito = new PdfPCell(pnumcredito); PdfPCell colonia = new PdfPCell(pcolonia); PdfPCell titulosaldo = new PdfPCell(new Phrase("Saldo Vencido")); PdfPCell deleg = new PdfPCell(pdelegacion); PdfPCell saldo = new PdfPCell(psaldo); PdfPCell ciudadCP = new PdfPCell(pestadpCp); PdfPCell blanco = new PdfPCell(new Phrase(" ")); nombre.setBorder(Rectangle.NO_BORDER); titulocred.setBorder(Rectangle.NO_BORDER); titulocred.setHorizontalAlignment(Chunk.ALIGN_RIGHT); calle.setBorder(Rectangle.NO_BORDER); numcredito.setBorder(Rectangle.NO_BORDER); numcredito.setHorizontalAlignment(Chunk.ALIGN_RIGHT); colonia.setBorder(Rectangle.NO_BORDER); titulosaldo.setBorder(Rectangle.NO_BORDER); titulosaldo.setHorizontalAlignment(Chunk.ALIGN_RIGHT); deleg.setBorder(Rectangle.NO_BORDER); saldo.setBorder(Rectangle.NO_BORDER); saldo.setHorizontalAlignment(Chunk.ALIGN_RIGHT); ciudadCP.setBorder(Rectangle.NO_BORDER); blanco.setBorder(Rectangle.NO_BORDER); datos.addCell(nombre); datos.addCell(titulocred); datos.addCell(calle); datos.addCell(numcredito); datos.addCell(colonia); datos.addCell(titulosaldo); datos.addCell(deleg); datos.addCell(saldo); datos.addCell(ciudadCP); datos.addCell(blanco); documento.add(new Paragraph(Chunk.NEWLINE)); documento.add(new Paragraph(Chunk.NEWLINE)); documento.add(new Paragraph(Chunk.NEWLINE)); documento.add(datos); p = new Paragraph("Credito CT Express", tituloN2); p.setAlignment(Chunk.ALIGN_RIGHT); documento.add(p); documento.add(new Paragraph(Chunk.NEWLINE)); p = new Paragraph( "Srvase la presente, como requerimiento de pago a favor de Inbursa para regularizar su situacin de adeudo que actualmente presenta en la Linea de Crdito CT Express otorgada por Inbursa.", cuerpo); p.setAlignment(Chunk.ALIGN_JUSTIFIED); documento.add(p); documento.add(new Paragraph(Chunk.NEWLINE)); p = new Paragraph( "Recuerde que este Crdito se otorg con base en su excelente historial de pago y manejo de su cuenta CT y ahora lo exhortamos a que regularize esta situacin a la brevedad, evitando as, situaciones inconvenientes y daando su buena imagen crediticia.", cuerpo); p.setAlignment(Chunk.ALIGN_JUSTIFIED); documento.add(p); p = new Paragraph( "Representamos a Inbursa para que recuperemos los pagos atrasados de la Lnea de Crdito que se otorg.", cuerpo); p.setAlignment(Chunk.ALIGN_JUSTIFIED); documento.add(p); documento.add(new Paragraph(Chunk.NEWLINE)); p = new Paragraph( "Invariablemente el pago de lo atrasado, deber hacerse nicamente en la Sucursal de Banco Inbursa de su eleccin, a las siguientes Cuentas:", cuerpo); p.setAlignment(Chunk.ALIGN_CENTER); documento.add(p); documento.add(new Paragraph(Chunk.NEWLINE)); p = new Paragraph("CUENTA CONCENTRADORA 50015025905 a nombre de Banco Inbursa Cobranza Express PYME \n" + "o mediante SPEI a la Cuenta 036180-50015025905-6\n" + "o bien en Bancomer:\n" + "Convenio CIE 386120 Referencia 50015025902", cuerpo); p.setAlignment(Chunk.ALIGN_CENTER); documento.add(p); p = new Paragraph("Y no olvide remitirnos el pago de su crdito va correo electrnico.", cuerpoNegritas); p.setAlignment(Chunk.ALIGN_CENTER); documento.add(p); documento.add(new Paragraph(Chunk.NEWLINE)); documento.add(new Paragraph(Chunk.NEWLINE)); p = new Paragraph( "Contamos con sus Pagos y con su Comunicacin donde un asesor de este Corporativo le atender. EN CASO DE QUE REQUIERA PLAZO PARA PAGAR, CONTACTENOS.", cuerpo); p.setAlignment(Chunk.ALIGN_JUSTIFIED); documento.add(p); documento.add(new Paragraph(Chunk.NEWLINE)); p = new Paragraph("A T E N T A M E N T E", cuerpo); p.setAlignment(Chunk.ALIGN_JUSTIFIED); documento.add(p); documento.add(new Paragraph(Chunk.NEWLINE)); documento.add(new Paragraph(Chunk.NEWLINE)); p = new Paragraph("BUFETE DEL RIO, S.C.", cuerpo); p.setAlignment(Chunk.ALIGN_JUSTIFIED); documento.add(p); documento.add(new Paragraph(Chunk.NEWLINE)); p = new Paragraph( "BUFETE DEL RIO, S.C. una Divisin de CORPORATIVO DEL RIO Y ASOCIADOS S.C.\n" + "AVISO DE PRIVACIDAD. Puede ser consultado en la pgina Web www.corporativodelrio.com", cuerpoMini); p.setAlignment(Chunk.ALIGN_JUSTIFIED); documento.add(p); }
From source file:com.pdfs.GeneradorVisitas.java
public void addCreditosTelmex(DatosVisitaDomiciliaria credito) throws DocumentException { documento.add(foto);//from ww w . jav a 2s. c o m Paragraph p = new Paragraph("BUFETE DEL RIO, S.C.", tituloN1); p.setAlignment(Chunk.ALIGN_CENTER); documento.add(p); p = new Paragraph("La Firma Marca la Diferencia ", tituloN2); p.setAlignment(Chunk.ALIGN_CENTER); documento.add(p); p = new Paragraph("Balboa 1111, Portales Sur, 03300, Mxico, D.F.", tituloN3); p.setAlignment(Chunk.ALIGN_CENTER); documento.add(p); p = new Paragraph("(55) 5539 0104 con 10 Lneas contacto@corporativodelrio.com", tituloN3); p.setAlignment(Chunk.ALIGN_CENTER); documento.add(p); PdfPTable datos = new PdfPTable(2); datos.setWidthPercentage(90); Phrase pnombre = new Phrase(credito.getNombre()); pnombre.setFont(cuerpo2); Phrase pcalle = new Phrase(credito.getCalle()); pcalle.setFont(cuerpo2); Phrase pnumcredito = new Phrase(credito.getNumcredito()); pnumcredito.setFont(cuerpo2); Phrase pcolonia = new Phrase(credito.getColonia()); pcolonia.setFont(cuerpo2); Phrase pdelegacion = new Phrase(credito.getDelegacion()); pdelegacion.setFont(cuerpo2); float sdo = credito.getSaldo(); Phrase psaldo = new Paragraph(nf.format(sdo)); psaldo.setFont(cuerpo2); Phrase pestadpCp = new Phrase(credito.getEstado() + " " + credito.getCp()); pestadpCp.setFont(cuerpo2); PdfPCell nombre = new PdfPCell(pnombre); PdfPCell titulocred = new PdfPCell(new Phrase("N Crdito")); PdfPCell calle = new PdfPCell(pcalle); PdfPCell numcredito = new PdfPCell(pnumcredito); PdfPCell colonia = new PdfPCell(pcolonia); PdfPCell titulosaldo = new PdfPCell(new Phrase("Saldo Vencido")); PdfPCell deleg = new PdfPCell(pdelegacion); PdfPCell saldo = new PdfPCell(psaldo); PdfPCell ciudadCP = new PdfPCell(pestadpCp); PdfPCell blanco = new PdfPCell(new Phrase(" ")); nombre.setBorder(Rectangle.NO_BORDER); titulocred.setBorder(Rectangle.NO_BORDER); titulocred.setHorizontalAlignment(Chunk.ALIGN_RIGHT); calle.setBorder(Rectangle.NO_BORDER); numcredito.setBorder(Rectangle.NO_BORDER); numcredito.setHorizontalAlignment(Chunk.ALIGN_RIGHT); colonia.setBorder(Rectangle.NO_BORDER); titulosaldo.setBorder(Rectangle.NO_BORDER); titulosaldo.setHorizontalAlignment(Chunk.ALIGN_RIGHT); deleg.setBorder(Rectangle.NO_BORDER); saldo.setBorder(Rectangle.NO_BORDER); saldo.setHorizontalAlignment(Chunk.ALIGN_RIGHT); ciudadCP.setBorder(Rectangle.NO_BORDER); blanco.setBorder(Rectangle.NO_BORDER); datos.addCell(nombre); datos.addCell(titulocred); datos.addCell(calle); datos.addCell(numcredito); datos.addCell(colonia); datos.addCell(titulosaldo); datos.addCell(deleg); datos.addCell(saldo); datos.addCell(ciudadCP); datos.addCell(blanco); documento.add(new Paragraph(Chunk.NEWLINE)); documento.add(new Paragraph(Chunk.NEWLINE)); documento.add(new Paragraph(Chunk.NEWLINE)); documento.add(datos); p = new Paragraph("Crdito TELMEX", tituloN2); p.setAlignment(Chunk.ALIGN_RIGHT); documento.add(p); documento.add(new Paragraph(Chunk.NEWLINE)); p = new Paragraph( "Srvase la presente, como requerimiento de pago a favor de Inbursa para regularizar su situacin de adeudo que actualmente presenta en la Linea de Crdito Telmex otorgada por Inbursa.", cuerpo); p.setAlignment(Chunk.ALIGN_JUSTIFIED); documento.add(p); documento.add(new Paragraph(Chunk.NEWLINE)); p = new Paragraph( "Recuerde que este Crdito se otorg con base en su excelente historial de pago puntual de su Lnea Telmex y ahora lo exhortamos a que regularize esta situacin a la brevedad, evitando situaciones inconvenientes y daando su buena imagen crediticia.", cuerpo); p.setAlignment(Chunk.ALIGN_JUSTIFIED); documento.add(p); p = new Paragraph( "Representamos a Inbursa para que recuperemos los pagos atrasados de la Lnea de Crdito que se otorg.", cuerpo); p.setAlignment(Chunk.ALIGN_JUSTIFIED); documento.add(p); documento.add(new Paragraph(Chunk.NEWLINE)); p = new Paragraph( "Invariablemente el pago de lo atrasado, deber hacerse nicamente en la Sucursal de Banco Inbursa de su eleccin, a las siguientes Cuentas:", cuerpo); p.setAlignment(Chunk.ALIGN_CENTER); documento.add(p); documento.add(new Paragraph(Chunk.NEWLINE)); p = new Paragraph("CUENTA CONCENTRADORA 50015025745 a nombre de Banco Inbursa Cobranza Telmex\n" + "o mediante SPEI a la Cuenta 036180-50015025745-6\n" + "o bien en Bancomer:\n" + "Convenio CIE 386120 Referencia 50015025741", cuerpo); p.setAlignment(Chunk.ALIGN_CENTER); documento.add(p); p = new Paragraph("Y no olvide remitirnos el pago de su crdito va correo electrnico.", cuerpoNegritas); p.setAlignment(Chunk.ALIGN_CENTER); documento.add(p); documento.add(new Paragraph(Chunk.NEWLINE)); documento.add(new Paragraph(Chunk.NEWLINE)); p = new Paragraph( "Contamos con sus Pagos y con su Comunicacin donde un asesor de este Corporativo le atender. EN CASO DE QUE REQUIERA PLAZO PARA PAGAR, CONTACTENOS.", cuerpo); p.setAlignment(Chunk.ALIGN_JUSTIFIED); documento.add(p); documento.add(new Paragraph(Chunk.NEWLINE)); p = new Paragraph("A T E N T A M E N T E", cuerpo); p.setAlignment(Chunk.ALIGN_JUSTIFIED); documento.add(p); documento.add(new Paragraph(Chunk.NEWLINE)); documento.add(new Paragraph(Chunk.NEWLINE)); p = new Paragraph("BUFETE DEL RIO, S.C.", cuerpo); p.setAlignment(Chunk.ALIGN_JUSTIFIED); documento.add(p); documento.add(new Paragraph(Chunk.NEWLINE)); p = new Paragraph( "BUFETE DEL RIO, S.C. una Divisin de CORPORATIVO DEL RIO Y ASOCIADOS S.C.\n" + "AVISO DE PRIVACIDAD. Puede ser consultado en la pgina Web www.corporativodelrio.com", cuerpoMini); p.setAlignment(Chunk.ALIGN_JUSTIFIED); documento.add(p); }