Open KevinVG opened 5 years ago
Found a possible solution in Html2Pdf.php:
/**
* make a break line
*
* @access protected
* @param float $h current line height
* @param integer $curr real current position in the text, if new line in the write of a text
*/
protected function _makeBreakLine($h, $curr = null)
{
if ($h) {
$bottomLineHeight = 0;
if (isset($this->parsingCss->value['line-height']) && isset($this->parsingCss->value['line-height'])) {
$bottomLineHeight = ($this->cssConverter->convertToMM($this->parsingCss->value['line-height']) - $this->cssConverter->convertToMM($this->parsingCss->value['font-size']));
}
if (( $this->pdf->GetY()+ $h - $bottomLineHeight < $this->pdf->getH() - $this->pdf->getbMargin()) || $this->_isInOverflow || $this->_isInFooter) {
$this->_setNewLine($h, $curr);
} else {
$this->_setNewPage(null, '', null, $curr);
}
} else {
$this->_setNewPositionForNewLine($curr);
}
$this->_maxH = 0;
$this->_maxE = 0;
}
Hi,
When we create a PDF where there is a text in a TD with a line-height, the line-height triggers a new page and the next table cell is displayed on the next page at the bottom instead of the same page on the same row
In this example, the "Value" table cell is displayed at the bottom right of page 2 instead of page 1. How can we fix this, so that the "Value" cell is displayed next to the "Text" cell?