mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 10:26:40 +02:00
Merge branch 'MOODLE_310_MDL-70093' of https://github.com/golenkovm/moodle into MOODLE_310_STABLE
This commit is contained in:
commit
477cd8b5fe
1 changed files with 7 additions and 2 deletions
|
@ -135,14 +135,19 @@ class writer extends \core\dataformat\base {
|
||||||
// height. Solution similar to that at https://stackoverflow.com/a/1943096.
|
// height. Solution similar to that at https://stackoverflow.com/a/1943096.
|
||||||
$pdf2 = clone $this->pdf;
|
$pdf2 = clone $this->pdf;
|
||||||
$pdf2->startTransaction();
|
$pdf2->startTransaction();
|
||||||
|
$numpages = $pdf2->getNumPages();
|
||||||
$pdf2->AddPage('L');
|
$pdf2->AddPage('L');
|
||||||
$pdf2->writeHTMLCell($this->colwidth, 0, '', '', $cell, 1, 1, false, true, 'L');
|
$pdf2->writeHTMLCell($this->colwidth, 0, '', '', $cell, 1, 1, false, true, 'L');
|
||||||
$rowheight = max($rowheight, $pdf2->getY() - $pdf2->getMargins()['top']);
|
$pagesadded = $pdf2->getNumPages() - $numpages;
|
||||||
|
$pageheight = $pdf2->getPageHeight() - $pdf2->getMargins()['top'] - $pdf2->getMargins()['bottom'];
|
||||||
|
$cellheight = ($pagesadded - 1) * $pageheight + $pdf2->getLastH();
|
||||||
|
$rowheight = max($rowheight, $cellheight);
|
||||||
$pdf2->rollbackTransaction();
|
$pdf2->rollbackTransaction();
|
||||||
}
|
}
|
||||||
|
|
||||||
$margins = $this->pdf->getMargins();
|
$margins = $this->pdf->getMargins();
|
||||||
if ($this->pdf->GetY() + $rowheight + $margins['bottom'] > $this->pdf->getPageHeight()) {
|
if ($this->pdf->getNumPages() > 1 &&
|
||||||
|
($this->pdf->GetY() + $rowheight + $margins['bottom'] > $this->pdf->getPageHeight())) {
|
||||||
$this->pdf->AddPage('L');
|
$this->pdf->AddPage('L');
|
||||||
$this->print_heading();
|
$this->print_heading();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue