Hello,
I'm updating my application to be compatible with PHP7.2 (from 5.6), so I had to update to mpdf 7.
By doing this, I think I discovered a bug with the CSS rem unit.
Here's an example which works in 6.1.4 but doesn't in 7.0.2 (or 7.0) :
// 6.1.4
$mpdf = new \mPDF('utf-8', 'A4-L');
$mpdf->WriteHTML($html);
$mpdf->Output($file, 'F');
// 7.0
$mpdf = new Mpdf([
'mode' => 'utf-8',
'format' => 'A4-L'
]);
$mpdf->WriteHTML($html);
$mpdf->Output($file, Destination::FILE);
And the corresponding HTML :
<!doctype html>
<html lang="en">
<body style="font-size: 14px;">
<div>
Hello world
</div>
<div style="font-size: 2rem;">
Hello world
<div style="font-size: 2rem;">
Hello world
</div>
</div>
</body>
</html>
In 6.1.4, the result is good with the last two "Hello world" twice as big as the first one.
But in 7.0, all three are the same size (14px).
If I replace rem to em in 7.0, the third is twice as big as the second, which is twice as big as the first.
I don't see in the docs that rem support has been droped in 7.0, so I think it's a bug. What do you think ?
Thank's by advance ;-)
the same problem here
I'm having the same issue.
Having the same issue. It's been 9 months.
Fixed in v7.1.4
Most helpful comment
I'm having the same issue.