iTextSharp.text.pdf.PdfPRow.SetExtraHeight C# (CSharp) Method

SetExtraHeight() public method

public SetExtraHeight ( int cell, float height ) : void
cell int
height float
return void
        public void SetExtraHeight(int cell, float height)
        {
            if (cell < 0 || cell >= cells.Length)
                return;
            extraHeights[cell] = height;
        }

Usage Example

Example #1
0
        /**
        * Calculates the extra height needed in a row because of rowspans.
        * @param    start   the index of the start row (the one to adjust)
        * @param    end     the index of the end row on the page
        * @since    2.1.6
        */

        virtual protected PdfPRow AdjustCellsInRow(int start, int end)
        {
            PdfPRow row = GetRow(start);
            if (row.Adjusted) return row;
            row = new PdfPRow(row);
            PdfPCell cell;
            PdfPCell[] cells = row.GetCells();
            for (int i = 0; i < cells.Length; i++)
            {
                cell = cells[i];
                if (cell == null || cell.Rowspan == 1)
                    continue;
                int stop = Math.Min(end, start + cell.Rowspan);
                float extra = 0;
                for (int k = start + 1; k < stop; k++)
                {
                    extra += GetRow(k).MaxHeights;
                }
                row.SetExtraHeight(i, extra);
            }
            row.Adjusted = true;
            return row;
        }