function measure(row, rowIndex) {
  // ===================
  // Add cells to buffer
  // ===================
  row.forEach((cell) => this._rowBuffer.add(cell));

  if (rowIndex > 0) {
    this._rowYPos[rowIndex] =
      this._rowYPos[rowIndex - 1] + this._rowHeights[rowIndex - 1];
  }

  const rowStyle = this._rowStyle(rowIndex);

  // ========================================================
  // Find any cells which are to finish rendering on this row
  // ========================================================
  /** @type {SizedNormalizedTableCellStyle[]} */
  let toRender = [];
  this._rowBuffer.forEach((cell) => {
    if (cell.rowIndex + cell.rowSpan - 1 === rowIndex) {
      toRender.push(measureCell.call(this, cell, rowStyle.height));
      this._rowBuffer.delete(cell);
    }
  });

  // =====================================================
  // Find the shared height for the row based on the cells
  // =====================================================
  let rowHeight = rowStyle.height;
  if (rowHeight === 'auto') {
    // Compute remaining height on cells
    rowHeight = toRender.reduce((acc, cell) => {
      let minHeight =
        cell.textBounds.height + cell.padding.top + cell.padding.bottom;
      for (let i = 0; i < cell.rowSpan - 1; i++) {
        minHeight -= this._rowHeights[cell.rowIndex + i];
      }
      return Math.max(acc, minHeight);
    }, 0);
  }

  rowHeight = Math.max(rowHeight, rowStyle.minHeight);
  if (rowStyle.maxHeight > 0) {
    rowHeight = Math.min(rowHeight, rowStyle.maxHeight);
  }
  this._rowHeights[rowIndex] = rowHeight;

  let newPage = false;
  if (rowHeight > this.document.page.contentHeight) {
    // We are unable to render this row on a single page, for now we log a warning and disable the newPage
    console.warn(
      new Error(
        `Row ${rowIndex} requested more than the safe page height, row has been clamped`,
      ).stack.slice(7),
    );
    this._rowHeights[rowIndex] =
      this.document.page.maxY() - this._rowYPos[rowIndex];
  } else if (this._rowYPos[rowIndex] + rowHeight >= this.document.page.maxY()) {
    // If row is going to go over the safe page height then move it over to new page
    this._rowYPos[rowIndex] = this.document.page.margins.top;
    newPage = true;
  }

  // =====================================================
  // Re-measure the cells using the know known height
  // =====================================================
  return {
    newPage,
    toRender: toRender.map((cell) => measureCell.call(this, cell, rowHeight)),
  };
}
Compute the dimensions of the cells

@this PDFTable
@memberOf PDFTable
@param {NormalizedTableCellStyle[]} row
@param {number} rowIndex
@returns {{newPage: boolean, toRender: SizedNormalizedTableCellStyle[]}}
@private