示例#1
0
 /**
  * Constructs a <CODE>PdfPCell</CODE> with a <CODE>Phrase</CODE>. The default padding is 2.
  *
  * @param phrase the text
  */
 public PdfPCell(Phrase phrase) {
   super(0, 0, 0, 0);
   borderWidth = 0.5f;
   border = BOX;
   column.addText(this.phrase = phrase);
   column.setLeading(0, 1);
 }
示例#2
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);
   }
 }