private PdfPCell buildPdfPCell(HeaderFooter phf,String text,int type){ PdfPCell cell=new PdfPCell(); cell.setPadding(0); cell.setBorder(Rectangle.NO_BORDER); Font font=FontBuilder.getFont(phf.getFontFamily(), phf.getFontSize(), phf.isBold(), phf.isItalic(),phf.isUnderline()); String fontColor=phf.getForecolor(); if(StringUtils.isNotEmpty(fontColor)){ String[] color=fontColor.split(","); font.setColor(Integer.valueOf(color[0]), Integer.valueOf(color[1]), Integer.valueOf(color[2])); } Paragraph graph=new Paragraph(text,font); cell.setPhrase(graph); switch(type){ case 1: cell.setHorizontalAlignment(Element.ALIGN_LEFT); break; case 2: cell.setHorizontalAlignment(Element.ALIGN_CENTER); break; case 3: cell.setHorizontalAlignment(Element.ALIGN_RIGHT); break; } cell.setVerticalAlignment(Element.ALIGN_MIDDLE); return cell; } }
/** * Sets the padding of the contents in the cell (space between content and border). * * @param padding */ public void setPadding( float padding ) { getWrapperCell().setPadding( padding ); }
/** * Sets the padding of the contents in the cell (space between content and border). * * @param padding */ public void setBorderPadding( float padding ) { getWrapperCell().setPadding( padding ); }
CellStyle colStyle=cellInfo.getColumn().getCustomCellStyle(); PdfPCell cell=newPdfCell(cellInfo,cellHeight); cell.setPadding(0); cell.setBorder(PdfPCell.NO_BORDER); cell.setCellEvent(new CellBorderEvent(style,customStyle));
private synchronized PdfPCell createPdfPCell() { if ( cell != null ) { return cell; } PdfPCell cell = new PdfPCell(); cell.setBorder( Rectangle.NO_BORDER ); cell.setPadding( 0 ); return cell; }
private synchronized PdfPCell createPdfPCell() { if ( cell != null ) { return cell; } PdfPCell cell = new PdfPCell(); cell.setBorder( Rectangle.NO_BORDER ); cell.setPadding( 0 ); return cell; }
private synchronized PdfPCell createPdfPCell() { if ( cell != null ) { return cell; } PdfPCell cell = new PdfPCell(); cell.setBorder( Rectangle.NO_BORDER ); cell.setPadding( 0 ); return cell; }
private PdfPCell createCell() { PdfPCell cell = new PdfPCell(); cell.setBorder( Rectangle.NO_BORDER ); cell.setPadding( 0.0f ); cell.setUseBorderPadding( true ); return cell; }
/** * Constructs a <CODE>PdfPCell</CODE> with an <CODE>Image</CODE>. The * default padding is 0.25 for a border width of 0.5. * * @param image the <CODE>Image</CODE> * @param fit <CODE>true</CODE> to fit the image to the cell */ public PdfPCell(Image image, boolean fit) { super(0, 0, 0, 0); borderWidth = 0.5f; border = BOX; column.setLeading(0, 1); if (fit) { this.image = image; setPadding(borderWidth / 2); } else { image.setScaleToFitLineWhenOverflow(false); column.addText(this.phrase = new Phrase(new Chunk(image, 0, 0, true))); setPadding(0); } }
/** * Constructs a <CODE>PdfPCell</CODE> with an <CODE>Image</CODE>. The * default padding is 0.25 for a border width of 0.5. * * @param image the <CODE>Image</CODE> * @param fit <CODE>true</CODE> to fit the image to the cell */ public PdfPCell(Image image, boolean fit) { super(0, 0, 0, 0); borderWidth = 0.5f; border = BOX; column.setLeading(0, 1); if (fit) { this.image = image; setPadding(borderWidth / 2); } else { image.setScaleToFitLineWhenOverflow(false); column.addText(this.phrase = new Phrase(new Chunk(image, 0, 0, true))); setPadding(0); } }
private PdfPCell createCell() { PdfPCell cell = new PdfPCell(); cell.setBorder( Rectangle.NO_BORDER ); cell.setPadding( 0.0f ); cell.setUseBorderPadding( true ); cell.getColumn().setAdjustFirstLine( false ); return cell; }
/** * Returns a formatted cell for the given value. * @param value cell value * @return Cell */ private PdfPCell getCell(String value) { PdfPCell cell = new PdfPCell(new Phrase(new Chunk(StringUtils.trimToEmpty(value), this.smallFont))); cell.setVerticalAlignment(Element.ALIGN_TOP); cell.setLeading(8, 0); cell.setPadding(2); return cell; }
private PdfPCell buildPdfPCell(HeaderFooter phf,String text,int type){ PdfPCell cell=new PdfPCell(); cell.setPadding(0); cell.setBorder(Rectangle.NO_BORDER); Font font=FontBuilder.getFont(phf.getFontFamily(), phf.getFontSize(), phf.isBold(), phf.isItalic(),phf.isUnderline()); String fontColor=phf.getForecolor(); if(StringUtils.isNotEmpty(fontColor)){ String[] color=fontColor.split(","); font.setColor(Integer.valueOf(color[0]), Integer.valueOf(color[1]), Integer.valueOf(color[2])); } Paragraph graph=new Paragraph(text,font); cell.setPhrase(graph); switch(type){ case 1: cell.setHorizontalAlignment(Element.ALIGN_LEFT); break; case 2: cell.setHorizontalAlignment(Element.ALIGN_CENTER); break; case 3: cell.setHorizontalAlignment(Element.ALIGN_RIGHT); break; } cell.setVerticalAlignment(Element.ALIGN_MIDDLE); return cell; } }
rotation = style.rotation; } else { setPadding(0);
rotation = style.rotation; } else { setPadding(0);
cell.setPadding(Float.parseFloat(value)); cell.setUseDescender(true);
cell.setPadding(Float.parseFloat(value)); cell.setUseDescender(true);
CellStyle colStyle=cellInfo.getColumn().getCustomCellStyle(); PdfPCell cell=newPdfCell(cellInfo,cellHeight); cell.setPadding(0); cell.setBorder(PdfPCell.NO_BORDER); cell.setCellEvent(new CellBorderEvent(style,customStyle));
c.setPadding(0); c.setBorder(img.getBorder()); c.setBorderColor(img.getBorderColor());