コード例 #1
0
 /// <summary>
 /// Constructs a  PdfPCell  with a  PdfPtable .
 /// This constructor allows nested tables.
 /// @since 2.1.0
 /// </summary>
 /// <param name="table">The  PdfPTable </param>
 /// <param name="style">The style to apply to the cell (you could use getDefaultCell())</param>
 public PdfPCell(PdfPTable table, PdfPCell style) : base(0, 0, 0, 0)
 {
     borderWidth = 0.5f;
     border      = BOX;
     Column.SetLeading(0, 1);
     _table = table;
     table.WidthPercentage = 100;
     table.ExtendLastRow   = true;
     Column.AddElement(table);
     if (style != null)
     {
         CloneNonPositionParameters(style);
         _verticalAlignment = style._verticalAlignment;
         _paddingLeft       = style._paddingLeft;
         _paddingRight      = style._paddingRight;
         _paddingTop        = style._paddingTop;
         _paddingBottom     = style._paddingBottom;
         _colspan           = style._colspan;
         _rowspan           = style._rowspan;
         _cellEvent         = style._cellEvent;
         _useDescender      = style._useDescender;
         _useBorderPadding  = style._useBorderPadding;
         _rotation          = style._rotation;
     }
     else
     {
         Padding = 0;
     }
 }
コード例 #2
0
 /// <summary>
 /// Adds an iText element to the cell.
 /// </summary>
 /// <param name="element"></param>
 public void AddElement(IElement element)
 {
     if (_table != null)
     {
         _table = null;
         Column.SetText(null);
     }
     Column.AddElement(element);
 }