public function __construct(Row $row, $text = '') { $this->row = $row; $this->setText($text); $this->setBorderWidth($row->getTable()->getBorderWidth()); $this->setFontFamily($row->getTable()->getFontFamily()); $this->setFontSize($row->getTable()->getFontSize()); $this->setFontWeight($row->getTable()->getFontWeight()); $this->setLineHeight($row->getTable()->getLineHeight()); $this->setPadding($row->getTable()->getPdf()->getCellPaddings()); }
/** * Splits cells with rowspan, which are larger than the page. * * @param Row $row * @param int $r * @param float $remainingPagePlace */ private function _splitRowspanCells($row, $r, $remainingPagePlace) { $rowspanInfos = $this->_getRowspanInfos(); $rowHeights = $this->_getRowHeights(); foreach ($row->getCells() as $c => $cell) { if (isset($rowspanInfos[$r][$c]) && 0 === $rowspanInfos[$r][$c]['position'] && !isset($rowspanInfos[$r][$c]['splitted'])) { $lastR = $r; $heightSum = 0; for ($r2 = 0; $r2 < $cell->getRowspan(); $r2++) { if ($heightSum + $rowHeights[$r + $r2] > $remainingPagePlace) { $rowspanInfos[$lastR][$c]['height_total'] = $heightSum; $rowspanInfos[$lastR][$c]['splitted'] = true; $rowspanInfos[$r + $r2][$c]['position'] = 0; $rowspanInfos[$r + $r2][$c]['cell'] = clone $cell; $lastR = $r + $r2; $heightSum = 0; $pdf = $row->getTable()->getPdf(); $remainingPagePlace = Helper::getPageContentHeight($pdf, $pdf->getPage()) - $this->_getPageBreakCallbackHeight(); } $heightSum += $rowHeights[$r + $r2]; } $rowspanInfos[$lastR][$c]['height_total'] = $heightSum; $rowspanInfos[$lastR][$c]['splitted'] = true; } } $this->rowspanInfos = $rowspanInfos; return $rowspanInfos; }