List of usage examples for com.itextpdf.text BaseColor BaseColor
public BaseColor(final float red, final float green, final float blue)
From source file:com.bdaum.zoom.ui.internal.dialogs.ExhibitionEditDialog.java
License:Open Source License
private static PdfPCell createTableCell(String value, int alignment) { PdfPCell cell = new PdfPCell(new Paragraph(value, FontFactory.getFont(FontFactory.HELVETICA, 9, com.itextpdf.text.Font.NORMAL, BaseColor.BLACK))); cell.setBorderColor(new BaseColor(224, 224, 224)); cell.setBorderWidth(1);//from w ww.j a va2s. c o m cell.setPadding(5); cell.setHorizontalAlignment(alignment); return cell; }
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);// ww w .ja v a2 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.cs.sis.controller.gerador.GeradorPDF.java
private PdfPTable getTableDeItens(List<ItemDeVenda> itens) throws DocumentException { PdfPTable table = new PdfPTable(4); table.setWidths(new int[] { 5, 1, 1, 1 }); table.setWidthPercentage(100f);// w ww . j a v a 2 s . c om table.setSpacingBefore(10f); table.setSpacingAfter(10f); table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER); table.getDefaultCell().setBackgroundColor(new BaseColor(60, 171, 198)); table.addCell("Produto"); table.addCell("Quantidade"); table.addCell("Valor UN"); table.addCell("Total"); table.getDefaultCell().setBackgroundColor(null); for (ItemDeVenda it : itens) { table.addCell(it.getDescricaoProduto()); table.addCell(new DecimalFormat("0.000").format(it.getQuantidade())); table.addCell(new DecimalFormat("0.00").format(it.getValorProduto())); table.addCell(new DecimalFormat("0.00").format(it.getTotal())); } return table; }
From source file:com.cs.sis.controller.gerador.GeradorPDF.java
private PdfPTable getTableEstoqueProdutos(boolean valoresNegativos) throws DocumentException { double total_requisitado = 381624.18; Map<String, Double[]> saida = GeradorRelatorio.getRelatorioEstoqueProdutos(valoresNegativos); PdfPTable table = new PdfPTable(4); table.setWidths(new int[] { 5, 2, 1, 1 }); table.setWidthPercentage(100f);// www .j a v a2 s .com table.setSpacingBefore(10f); table.setSpacingAfter(10f); table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER); table.getDefaultCell().setBackgroundColor(new BaseColor(60, 171, 198)); table.addCell("Produto"); table.addCell("Quantidade em Estoque"); table.addCell("Valor de Compra"); table.addCell("SubTotal"); table.getDefaultCell().setBackgroundColor(null); double quantidade = 0, total = 0; List<String> c = new ArrayList<String>(); c.addAll(saida.keySet()); Collections.sort(c); for (String produto : c) { Double[] val = saida.get(produto); double qt, vc, sub; qt = val[0]; vc = val[1]; sub = val[0] * val[1]; if (qt > 0 && qt < 10000) { quantidade += qt; total += (qt * vc); table.addCell(produto); table.addCell(new DecimalFormat("0.000").format(qt)); table.addCell(new DecimalFormat("0.00").format(vc)); table.addCell(new DecimalFormat("0.00").format(qt * vc)); } else { continue; //table.addCell(new DecimalFormat("0.00").format(val[1])); //table.addCell(new DecimalFormat("0.000").format(0)); //table.addCell(new DecimalFormat("0.00").format(vc)); //table.addCell(new DecimalFormat("0.00").format(0)); } if (total_requisitado - 10 <= total && total <= total_requisitado + 10) { break; } } table.getDefaultCell().setBackgroundColor(new BaseColor(60, 171, 198)); PdfPCell cell = new PdfPCell(new Paragraph("Total")); cell.setColspan(2); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setBackgroundColor(new BaseColor(60, 171, 198)); table.addCell(cell); //table.addCell(OperacaoStringUtil.formatarStringValorIntegerEPonto( // saida.size()) + " Produtos"); //table.addCell(OperacaoStringUtil.formatarStringQuantidadeEPonto(quantidade) // + " Itens"); String tot = OperacaoStringUtil.formatarStringValorMoedaComDescricaoEPonto(381624.18); PdfPCell cel2 = new PdfPCell(new Paragraph(tot)); cel2.setColspan(2); cel2.setHorizontalAlignment(Element.ALIGN_CENTER); cel2.setBackgroundColor(new BaseColor(60, 171, 198)); table.addCell(cel2); //table.addCell(OperacaoStringUtil.formatarStringValorMoedaComDescricaoEPonto(total)); //System.out.println(total); return table; }
From source file:com.cs.sis.controller.gerador.GeradorPDF.java
private PdfPTable getTableEstoqueProdutos(boolean valoresNegativos, boolean paraLista, List<String> codigos_retirados, double total_requisitado) throws DocumentException { //double total_requisitado = 381624.18; Map<String, Double[]> saida = GeradorRelatorio.getRelatorioEstoqueProdutos(valoresNegativos, codigos_retirados);//from www .jav a2 s . c om PdfPTable table = new PdfPTable(4); table.setWidths(new int[] { 5, 2, 1, 1 }); table.setWidthPercentage(100f); table.setSpacingBefore(10f); table.setSpacingAfter(10f); table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER); table.getDefaultCell().setBackgroundColor(new BaseColor(60, 171, 198)); table.addCell("Produto"); table.addCell("Quantidade em Estoque"); table.addCell("Valor de Compra"); table.addCell("SubTotal"); table.getDefaultCell().setBackgroundColor(null); double quantidade = 0, total = 0; List<String> c = new ArrayList<String>(); c.addAll(saida.keySet()); Collections.sort(c); for (String produto : c) { if (paraLista && total_requisitado <= total) { break; } Double[] val = saida.get(produto); double qt, vc, sub; qt = val[0]; vc = val[1]; sub = val[0] * val[1]; if (qt > 0 && qt < 10000) { quantidade += qt; total += (qt * vc); table.addCell(produto); table.addCell(new DecimalFormat("0.000").format(qt)); table.addCell(new DecimalFormat("0.00").format(vc)); table.addCell(new DecimalFormat("0.00").format(qt * vc)); } else { continue; //table.addCell(new DecimalFormat("0.00").format(val[1])); //table.addCell(new DecimalFormat("0.000").format(0)); //table.addCell(new DecimalFormat("0.00").format(vc)); //table.addCell(new DecimalFormat("0.00").format(0)); } } table.getDefaultCell().setBackgroundColor(new BaseColor(60, 171, 198)); PdfPCell cell = new PdfPCell(new Paragraph("Total")); cell.setColspan(2); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setBackgroundColor(new BaseColor(60, 171, 198)); table.addCell(cell); //table.addCell(OperacaoStringUtil.formatarStringValorIntegerEPonto( // saida.size()) + " Produtos"); //table.addCell(OperacaoStringUtil.formatarStringQuantidadeEPonto(quantidade) // + " Itens"); String tot = OperacaoStringUtil.formatarStringValorMoedaComDescricaoEPonto(total_requisitado); PdfPCell cel2 = new PdfPCell(new Paragraph(tot)); cel2.setColspan(2); cel2.setHorizontalAlignment(Element.ALIGN_CENTER); cel2.setBackgroundColor(new BaseColor(60, 171, 198)); table.addCell(cel2); //table.addCell(OperacaoStringUtil.formatarStringValorMoedaComDescricaoEPonto(total)); //System.out.println(total); return table; }
From source file:com.cs.sis.controller.gerador.GeradorPDF.java
private PdfPTable getTableBalancoProdutos(Date inicio, Date fim) throws DocumentException { Map<String, Double[]> saida = GeradorRelatorio.getRelatorioDetalhadoSaidaProduto(inicio, fim); PdfPTable table = new PdfPTable(5); table.setWidths(new int[] { 5, 1, 1, 1, 1 }); table.setWidthPercentage(100f);// w ww .j a v a 2 s.c o m table.setSpacingBefore(10f); table.setSpacingAfter(10f); table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER); table.getDefaultCell().setBackgroundColor(new BaseColor(60, 171, 198)); table.addCell("Produto"); table.addCell("Estoque"); table.addCell("Compra"); table.addCell("Venda"); table.addCell("Lucro"); table.getDefaultCell().setBackgroundColor(null); double compra = 0, venda = 0, lucro = 0, qt = 0; List<String> c = new ArrayList<String>(); c.addAll(saida.keySet()); Collections.sort(c); for (String produto : c) { table.addCell(produto); Double[] val = saida.get(produto); compra += val[0]; venda += val[1]; lucro += val[3]; qt += val[2]; table.addCell(new DecimalFormat("0.000").format(val[2])); table.addCell(new DecimalFormat("0.00").format(val[0])); table.addCell(new DecimalFormat("0.00").format(val[1])); table.addCell(new DecimalFormat("0.00").format(val[3])); } table.getDefaultCell().setBackgroundColor(new BaseColor(60, 171, 198)); PdfPCell cell = new PdfPCell(new Paragraph("Total")); cell.setColspan(5); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setBackgroundColor(new BaseColor(60, 171, 198)); table.addCell(cell); table.addCell(saida.size() + " Produtos"); table.addCell(new DecimalFormat("0.000").format(qt)); table.addCell(new DecimalFormat("0.00").format(compra)); table.addCell(new DecimalFormat("0.00").format(venda)); table.addCell(new DecimalFormat("0.00").format(lucro)); return table; }
From source file:com.cs.sis.controller.gerador.GeradorPDF.java
private PdfPTable getTableDebitoClientes(double maiorQue) throws DocumentException { List<Object[]> debitos = GeradorRelatorio.getRelatorioClientesComDebitoMaiorQue(maiorQue); PdfPTable table = new PdfPTable(2); table.setWidths(new int[] { 5, 2 }); table.setWidthPercentage(100f);// ww w. ja va 2 s. c om table.setSpacingBefore(10f); table.setSpacingAfter(10f); table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER); table.getDefaultCell().setBackgroundColor(new BaseColor(60, 171, 198)); table.addCell("Cliente"); table.addCell("Dbito"); table.getDefaultCell().setBackgroundColor(null); double total = 0; for (Object[] d : debitos) { table.addCell((String) d[0]); double val = (double) d[1]; table.addCell(OperacaoStringUtil.formatarStringValorMoedaEPonto(val)); total += val; } table.getDefaultCell().setBackgroundColor(new BaseColor(60, 171, 198)); PdfPCell cell = new PdfPCell(new Paragraph("Total")); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setBackgroundColor(new BaseColor(60, 171, 198)); table.addCell(cell); table.addCell(OperacaoStringUtil.formatarStringValorMoedaComDescricaoEPonto(total)); table.addCell("Quantidade de Clientes"); table.addCell(OperacaoStringUtil.formatarStringValorInteger(debitos.size())); return table; }
From source file:com.devox.GUI.PDF.ExportarAPDF.java
private static void drawLine(PdfContentByte contentByte) { contentByte.saveState();/*ww w . j a v a 2 s . c o m*/ contentByte.moveTo(550, 795); contentByte.lineTo(35, 795); contentByte.moveTo(550, 45); contentByte.lineTo(35, 45); contentByte.setLineWidth(3); contentByte.setColorStroke(new BaseColor(252, 204, 41)); contentByte.stroke(); contentByte.restoreState(); }
From source file:com.devox.GUI.PDF.ExportarAPDF.java
private static void drawLine2(PdfContentByte contentByte) { contentByte.saveState();/*from w w w. ja va 2 s.c o m*/ contentByte.moveTo(45, 35); contentByte.lineTo(795, 35); contentByte.moveTo(45, 550); contentByte.lineTo(795, 550); contentByte.setLineWidth(3); contentByte.setColorStroke(new BaseColor(252, 204, 41)); contentByte.stroke(); contentByte.restoreState(); }
From source file:com.gp.cong.logisoft.lcl.report.LclVoyageNotificationPdfCreator.java
public PdfPTable onStartPage(String realPath, String scheduleNo, String unitNo, String voyContent) throws Exception { String path = LoadLogisoftProperties.getProperty("application.image.logo"); Font fontArialBold = FontFactory.getFont("Arial", 10f, Font.BOLD); Font colorBoldFont = FontFactory.getFont("Arial", 12f, Font.BOLD, new BaseColor(00, 102, 00)); Phrase p = null;// ww w . j a va 2 s . c o m Paragraph pValues = null; table = new PdfPTable(6); table.setWidths(new float[] { 0.1f, 1.8f, 2.5f, 3.5f, 1.8f, 1.8f }); table.setWidthPercentage(100f); cell = new PdfPCell(); cell.setBorder(0); cell.setPadding(0f); cell.setRowspan(3); table.addCell(cell); cell = new PdfPCell(); cell.setPadding(0f); cell.setBorder(0); cell.setPaddingBottom(3f); p = new Phrase("", fontArialBold); p.setLeading(20f); cell.addElement(p); table.addCell(cell); cell = new PdfPCell(); cell.setBorder(0); cell.setPadding(0f); cell.setPaddingBottom(3f); pValues = new Paragraph(25f, "", fontArialBold); cell.addElement(pValues); table.addCell(cell); cell = new PdfPCell(); cell.setRowspan(3); cell.setBorder(0); cell.setPadding(0f); Image img = Image.getInstance(realPath + path); img.scalePercent(60); img.setAlignment(Element.ALIGN_CENTER); img.setAlignment(Element.ALIGN_TOP); cell.addElement(img); table.addCell(cell); cell = new PdfPCell(); cell.setBorder(0); cell.setPadding(0f); cell.setPaddingBottom(3f); pValues = new Paragraph(20f, "Date:", fontArialBold); pValues.setAlignment(Element.ALIGN_RIGHT); cell.addElement(pValues); table.addCell(cell); cell = new PdfPCell(); cell.setBorder(0); cell.setPadding(0f); cell.setPaddingBottom(3f); pValues = new Paragraph(20f, " " + DateUtils.formatStringDateToAppFormatMMM(new Date()), fontArialBold); pValues.setAlignment(Element.ALIGN_LEFT); cell.addElement(pValues); table.addCell(cell); cell = new PdfPCell(); cell.setPadding(0f); cell.setBorder(0); cell.setPaddingBottom(3f); table.addCell(cell); cell = new PdfPCell(); cell.setBorder(0); cell.setPaddingBottom(3f); cell.setPadding(0f); table.addCell(cell); cell = new PdfPCell(); cell.setBorder(0); cell.setPadding(0f); cell.setPaddingBottom(3f); pValues = new Paragraph(9f, "Time:", fontArialBold); pValues.setAlignment(Element.ALIGN_RIGHT); cell.addElement(pValues); table.addCell(cell); cell = new PdfPCell(); cell.setBorder(0); cell.setPadding(0f); cell.setPaddingBottom(3f); pValues = new Paragraph(9f, " " + DateUtils.formatStringDateToTimeTT(new Date()), fontArialBold); pValues.setAlignment(Element.ALIGN_LEFT); cell.addElement(pValues); table.addCell(cell); cell = new PdfPCell(); cell.setColspan(2); cell.setBorder(0); cell.setPadding(0f); cell.setPaddingBottom(3f); table.addCell(cell); cell = new PdfPCell(); cell.setColspan(2); cell.setBorder(0); cell.setPaddingBottom(3f); table.addCell(cell); //voyage cell = new PdfPCell(); cell.setBorder(0); cell.setColspan(3); table.addCell(cell); cell = new PdfPCell(); cell.setBorder(0); cell.setPaddingLeft(5f); pValues = new Paragraph(8f, "VOYAGE NOTIFICATION", colorBoldFont); pValues.setAlignment(Element.ALIGN_CENTER); cell.addElement(pValues); table.addCell(cell); cell = new PdfPCell(); cell.setBorder(0); cell.setColspan(2); table.addCell(cell); return table; }