iTextSharp.text.pdf.PdfPCell.GetMaxHeight C# (CSharp) Метод

GetMaxHeight() публичный Метод

public GetMaxHeight ( ) : float
Результат float
        public float GetMaxHeight()
        {
            bool pivoted = (Rotation == 90 || Rotation == 270);
            Image img = this.Image;
            if (img != null) {
                img.ScalePercent(100);
                float refWidth = pivoted ? img.ScaledHeight : img.ScaledWidth;
                float scale = (Right - EffectivePaddingRight
                        - EffectivePaddingLeft - Left) / refWidth;
                img.ScalePercent(scale * 100);
                float refHeight = pivoted ? img.ScaledWidth : img.ScaledHeight;
                Bottom = Top - EffectivePaddingTop - EffectivePaddingBottom - refHeight;
            }
            else {
                if (pivoted && HasFixedHeight())
                    Bottom = Top - FixedHeight;
                else {
                    ColumnText ct = ColumnText.Duplicate(Column);
                    float right, top, left, bottom;
                    if (pivoted) {
                        right = PdfPRow.RIGHT_LIMIT;
                        top = Right - EffectivePaddingRight;
                        left = 0;
                        bottom = Left + EffectivePaddingLeft;
                    }
                    else {
                        right = NoWrap ? PdfPRow.RIGHT_LIMIT : Right - EffectivePaddingRight;
                        top = Top - EffectivePaddingTop;
                        left = Left + EffectivePaddingLeft;
                        bottom = HasFixedHeight() ? top + EffectivePaddingBottom - FixedHeight : PdfPRow.BOTTOM_LIMIT;
                    }
                    PdfPRow.SetColumn(ct, left, bottom, right, top);
                    ct.Go(true);
                    if (pivoted)
                        Bottom = Top - EffectivePaddingTop - EffectivePaddingBottom - ct.FilledWidth;
                    else {
                        float yLine = ct.YLine;
                        if (UseDescender)
                            yLine += ct.Descender;
                        Bottom = yLine - EffectivePaddingBottom;
                    }
                }
            }
            float height = Height;
            if (height == EffectivePaddingTop + EffectivePaddingBottom)
                height = 0;
            if (HasFixedHeight())
                height = FixedHeight;
            else if (HasMinimumHeight() && height < MinimumHeight)
                height = MinimumHeight;
            return height;
        }

Usage Example

Пример #1
0
 /**
  * Calculates the heights of each cell in the row.
  *
  * @return the maximum height of the row.
  */
 virtual protected internal void CalculateHeights()
 {
     maxHeight = 0;
     for (int k = 0; k < cells.Length; ++k)
     {
         PdfPCell cell   = cells[k];
         float    height = 0;
         if (cell != null)
         {
             height = cell.GetMaxHeight();
             if ((height > maxHeight) && (cell.Rowspan == 1))
             {
                 maxHeight = height;
             }
         }
     }
     calculated = true;
 }
All Usage Examples Of iTextSharp.text.pdf.PdfPCell::GetMaxHeight