/** * 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 */ protected PdfPRow AdjustCellsInRow(int start, int end) { PdfPRow row = new PdfPRow(GetRow(start)); row.InitExtraHeights(); 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 += GetRowHeight(k); } row.SetExtraHeight(i, extra); } return row; }