/// <summary> /// Constructs a PdfPCell with a Phrase . /// The default padding is 2. /// </summary> /// <param name="phrase">the text</param> public PdfPCell(Phrase phrase) : base(0, 0, 0, 0) { borderWidth = 0.5f; border = BOX; Column.AddText(this.phrase = phrase); Column.SetLeading(0, 1); }
/// <summary> /// Constructs a PdfPCell with an Image . /// The default padding is 0.25 for a border width of 0.5. /// </summary> /// <param name="image">the Image </param> /// <param name="fit"> true to fit the image to the cell</param> public PdfPCell(Image image, bool fit) : base(0, 0, 0, 0) { borderWidth = 0.5f; border = BOX; if (fit) { _image = image; Column.SetLeading(0, 1); Padding = borderWidth / 2; } else { Column.AddText(phrase = new Phrase(new Chunk(image, 0, 0))); Column.SetLeading(0, 1); Padding = 0; } }