Hi,
mPDF is working really well with most of the HTML and CSS I have.
In one case, I get a "divide by 0" error in function _tableHeight.
That specific section is a table with a negative bottom margin.
The same HTML and CSS work well in browser.
I double checked the CSS support at https://mpdf.github.io/css-stylesheets/supported-css.html but couldn't find a clear answer whether this was supported or not...
I don't absolutely need the "negative margin" to work.
But it would be nice if mPDF was not causing a "divide by 0".
in function _tableHeight, the following line:
if ($remainingpage > $enddiv && $enddiv / $remainingpage < 0.05) {
crashes with "divide by 0".
$remainingpage is 0 but $enddiv is -0.7
The first part of the if would probably get us out of there before the / 0 but because $enddiv is negative, the first part of the if is positive so $enddiv / $remainingpage is executed and it crashes...
$enddiv is calculated just the one line above as such:
$enddiv = $this->blk[$this->blklvl]['padding_bottom'] + $this->blk[$this->blklvl]['border_bottom']['w'] + $table['margin']['B'];
In my case:
$this->blk[$this->blklvl]['padding_bottom'] = 0
$this->blk[$this->blklvl]['border_bottom']['w'] = 0
$table['margin']['B'] = -0.7
causing $table['margin']['B'] to be -0.7
Hi, mPDF is working really well with most of the HTML and CSS I have. In one case, I get a "divide by 0" error in function _tableHeight. That specific section is a table with a negative bottom margin. The same HTML and CSS work well in browser. I double checked the CSS support at https://mpdf.github.io/css-stylesheets/supported-css.html but couldn't find a clear answer whether this was supported or not... I don't absolutely need the "negative margin" to work.
But it would be nice if mPDF was not causing a "divide by 0".
in function _tableHeight, the following line: if ($remainingpage > $enddiv && $enddiv / $remainingpage < 0.05) { crashes with "divide by 0". $remainingpage is 0 but $enddiv is -0.7 The first part of the if would probably get us out of there before the / 0 but because $enddiv is negative, the first part of the if is positive so $enddiv / $remainingpage is executed and it crashes... $enddiv is calculated just the one line above as such: $enddiv = $this->blk[$this->blklvl]['padding_bottom'] + $this->blk[$this->blklvl]['border_bottom']['w'] + $table['margin']['B']; In my case: $this->blk[$this->blklvl]['padding_bottom'] = 0 $this->blk[$this->blklvl]['border_bottom']['w'] = 0 $table['margin']['B'] = -0.7 causing $table['margin']['B'] to be -0.7
Thank you.