List of usage examples for com.itextpdf.text Phrase Phrase
public Phrase()
Phrase
without specifying a leading. From source file:com.centurylink.mdw.pdf.PdfExportHelper.java
License:Apache License
private void printVariables(Chapter chapter, List<Variable> variables, int parentLevel) { Paragraph sTitle = new Paragraph("Process Variables", sectionFont); Section section = chapter.addSection(sTitle, parentLevel == 0 ? 0 : (parentLevel + 1)); com.itextpdf.text.List list = new com.itextpdf.text.List(false, false, 10.0f); for (Variable var : variables) { Phrase phrase = new Phrase(); phrase.add(new Chunk(var.getName(), fixedWidthFont)); String v = var.getType(); if (var.getDescription() != null) v += " (" + var.getDescription() + ")"; phrase.add(new Chunk(": " + v + "\n", normalFont)); list.add(new ListItem(phrase)); }//ww w . jav a 2 s .c o m section.add(list); }
From source file:com.chaschev.itext.PhraseBuilder.java
License:Apache License
public PhraseBuilder withNew() { element = new Phrase(); return this; }
From source file:com.cib.statementstamper.windows.StatementStamperMainWindow.java
License:Open Source License
protected PdfPTable getFooterTable(int x, int y) { PdfPTable table = new PdfPTable(1); table.setTotalWidth(537);//from w w w.j a va2 s . co m table.setLockedWidth(true); table.getDefaultCell().setFixedHeight(40); table.getDefaultCell().setBorder(Rectangle.TOP); table.getDefaultCell().setBorderColor(new BaseColor(221, 72, 20)); table.getDefaultCell().setBorderWidth(1); table.getDefaultCell().setPaddingLeft(0); table.getDefaultCell().setPaddingRight(0); table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_JUSTIFIED); Phrase phrase = new Phrase(); phrase.add(new Chunk(bottomChunk1, bottomFontBold)); phrase.add(new Chunk(bottomChunk2, bottomFont)); table.addCell(phrase); return table; }
From source file:com.devox.GUI.PDF.CrearReporteApto.java
private static Phrase getPhraseFromChunks(String a, String b) { Phrase phrase = new Phrase(); phrase.add(new Chunk(a, FUENTE_DATOS_IZQ)); phrase.add(new Chunk(b, FUENTE_DATOS_DER)); return phrase; }
From source file:com.devox.GUI.PDF.CrearReporteDestruccion.java
@Override public PdfPTable configurarInformacion() { PdfPTable table = new PdfPTable(2); try {// w w w .j ava 2 s . c om PdfPCell cell; Phrase folio = new Phrase(); folio.add(new Chunk("FOLIO DHL ", FUENTE_FOLIO_CHICA)); folio.add(new Chunk(contenido.getFolioDHL(), FUENTE_FOLIO_CHICA_ROJA)); cell = new PdfPCell(folio); cell.setRowspan(8); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); table.addCell(cell); cell = new PdfPCell(getPhraseFromChunks("Cliente ", contenido.getNombreCliente())); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); table.addCell(cell); cell = new PdfPCell(getPhraseFromChunks("Nmero de cliente ", contenido.getClaveCliente())); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); table.addCell(cell); cell = new PdfPCell(getPhraseFromChunks("Folio del cliente ", contenido.getFolioCliente())); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); table.addCell(cell); cell = new PdfPCell(getPhraseFromChunks("Folio Abbott ", contenido.getFolioAbbott())); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); table.addCell(cell); cell = new PdfPCell(getPhraseFromChunks("Motivo de devolucin ", contenido.getMotivo().getCodigo() + " - " + contenido.getMotivo().getDescripcion())); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); table.addCell(cell); cell = new PdfPCell(getPhraseFromChunks("Factura ", contenido.getFactura())); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); table.addCell(cell); cell = new PdfPCell(getPhraseFromChunks("Almacn ", contenido.getAlmacen())); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); table.addCell(cell); cell = new PdfPCell( getPhraseFromChunks("Fecha de captura ", Funciones.getOtherDate(contenido.getFechaCaptura()))); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); table.addCell(cell); table.setWidthPercentage(100); table.setWidths(new int[] { 1, 3 }); } catch (DocumentException ex) { Log.print(ex); } return table; }
From source file:com.devox.GUI.PDF.CrearReporteTarimas.java
@Override public PdfPTable configurarInformacion() { PdfPTable table = new PdfPTable(2); try {//from ww w. ja v a 2s .c o m PdfPCell cell; Phrase tarima = new Phrase(); tarima.add(new Chunk("TARIMA\n", FUENTE_TARIMA_NEGRO)); tarima.add(new Chunk(datosTarima.getNombreTarima(), FUENTE_TARIMA_ROJO)); cell = new PdfPCell(tarima); cell.setRowspan(5); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); cell.setFixedHeight(200f); table.addCell(cell); cell = new PdfPCell(getPhraseFromChunks("DIVISIN ", datosTarima.getDivision())); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); table.addCell(cell); cell = new PdfPCell(getPhraseFromChunks("ALMACN ", datosTarima.getAlmacen())); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); table.addCell(cell); cell = new PdfPCell(getPhraseFromChunks("FECHA DE APERTURA ", Funciones.getOtherDate(datosTarima.getFecha_Apertura()))); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); table.addCell(cell); cell = new PdfPCell(getPhraseFromChunks("FECHA DE CIERRE ", (datosTarima.getFecha_Cierra() == null ? "TARIMA ABIERTA" : Funciones.getOtherDate(datosTarima.getFecha_Cierra())))); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); table.addCell(cell); cell = new PdfPCell(getPhraseFromChunks("DESTRUCCIN FISCAL ", Integer.toString(datosTarima.getDestruccionFiscal()))); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); table.addCell(cell); table.setWidthPercentage(100); table.setWidths(new int[] { 2, 1 }); } catch (DocumentException de) { Log.print(de); } return table; }
From source file:com.devox.GUI.PDF.ExportarAPDF.java
private static PdfPTable setUpInformation() { PdfPTable table = new PdfPTable(2); try {/* w w w .j av a 2 s . com*/ PdfPCell cell; Phrase folio = new Phrase(); folio.add(new Chunk("FOLIO DHL ", font_foliodhl)); folio.add(new Chunk(contenido.getFolioDHL(), font_folionum)); cell = new PdfPCell(folio); cell.setRowspan(8); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); table.addCell(cell); cell = new PdfPCell(getPhraseFromChunks("Cliente ", contenido.getNombreCliente())); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); table.addCell(cell); cell = new PdfPCell(getPhraseFromChunks("Nmero de cliente ", contenido.getClaveCliente())); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); table.addCell(cell); cell = new PdfPCell(getPhraseFromChunks("Folio del cliente ", contenido.getFolioCliente())); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); table.addCell(cell); cell = new PdfPCell(getPhraseFromChunks("Folio Abbott ", contenido.getFolioAbbott())); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); table.addCell(cell); cell = new PdfPCell(getPhraseFromChunks("Motivo de devolucin ", contenido.getMotivo().getCodigo() + " - " + contenido.getMotivo().getDescripcion())); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); table.addCell(cell); cell = new PdfPCell(getPhraseFromChunks("Factura ", contenido.getFactura())); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); table.addCell(cell); cell = new PdfPCell(getPhraseFromChunks("Almacn ", contenido.getAlmacen())); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); table.addCell(cell); cell = new PdfPCell( getPhraseFromChunks("Fecha de captura ", Funciones.getOtherDate(contenido.getFechaCaptura()))); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); table.addCell(cell); table.setWidthPercentage(100); table.setWidths(new int[] { 1, 3 }); } catch (DocumentException ex) { Log.print(ex); Log.print(ex); } return table; }
From source file:com.devox.GUI.PDF.ExportarAPDF.java
private PdfPTable setUpInformationTarimas() { PdfPTable table = new PdfPTable(2); try {/*from ww w . j av a2 s. c o m*/ PdfPCell cell; Phrase tarima = new Phrase(); tarima.add(new Chunk("TARIMA\n", font_tarimota)); tarima.add(new Chunk(datosTarima.getNombreTarima(), font_tarimota_gris)); cell = new PdfPCell(tarima); cell.setRowspan(5); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); cell.setFixedHeight(200f); table.addCell(cell); cell = new PdfPCell(getPhraseFromChunks("DIVISIN ", datosTarima.getDivision())); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); table.addCell(cell); cell = new PdfPCell(getPhraseFromChunks("ALMACN ", datosTarima.getAlmacen())); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); table.addCell(cell); cell = new PdfPCell(getPhraseFromChunks("FECHA DE APERTURA ", Funciones.getOtherDate(datosTarima.getFecha_Apertura()))); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); table.addCell(cell); cell = new PdfPCell( getPhraseFromChunks("FECHA DE CIERRE ", Funciones.getOtherDate(datosTarima.getFecha_Cierra()))); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); table.addCell(cell); cell = new PdfPCell(getPhraseFromChunks("DESTRUCCIN FISCAL ", Integer.toString(datosTarima.getDestruccionFiscal()))); cell.setBorder(PdfPCell.NO_BORDER); cell.setPaddingLeft(40); table.addCell(cell); table.setWidthPercentage(100); table.setWidths(new int[] { 2, 1 }); } catch (DocumentException de) { Log.print(de); } return table; }
From source file:com.devox.GUI.PDF.ExportarAPDF.java
private static Phrase getPhraseFromChunks(String a, String b) { Phrase phrase = new Phrase(); phrase.add(new Chunk(a, font_info)); phrase.add(new Chunk(b, font_datos)); return phrase; }
From source file:com.microware.intrahealth.Createpdf2.java
private static void createTable1(Paragraph preface, String Text, String Value) throws BadElementException { Context _con = null;//w w w. j a v a 2s .c o m PdfPTable table = new PdfPTable(new float[] { 1, 3 }); table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT); for (int i = 0; i < 2; i++) { // table.addCell(new PdfPCell(new Phrase(Header[i], smallBold))); PdfPCell c1 = new PdfPCell(new Phrase()); table.addCell(c1); } PdfPCell[] cells = table.getRow(0).getCells(); // for (int j=0;j<cells.length;j++){ cells[0].setHorizontalAlignment(Element.ALIGN_LEFT); // } dataprovider = new DataProvider(_con); if (Text.length() > 0 && Value.length() > 0) { Phrase phrase = new Phrase(); phrase.add(new Chunk(Text, subFont)); table.addCell(phrase); table.addCell(Value); } else { Phrase phrase = new Phrase(); phrase.add(new Chunk(Text, subFont)); table.addCell(phrase); table.addCell(""); } preface.add(table); }