laravel-dompdf
laravel-dompdf copied to clipboard
TypeError round(): Argument #1 ($num) must be of type int|float, string given
Can I report it as a problem on dompdf I found it in line 3304 vendor\dompdf\dompdf\src\Css\Style.php
when I change
function set_z_index($val)
{
$this->_props["z_index"] = $val;
$this->_props_computed["z_index"] = null;
$this->_prop_cache["z_index"] = null;
if (round($val) != $val && $val !== "auto") {
return;
}
$this->_props_computed["z_index"] = $val;
}
to
function set_z_index($val)
{
$this->_props["z_index"] = $val;
$this->_props_computed["z_index"] = null;
$this->_prop_cache["z_index"] = null;
if($val !== "auto"){
if (round($val) != $val) {
return;
}
}
$this->_props_computed["z_index"] = $val;
}
error gone and running well, I'm using "php": "^7.3|^8.0", // actualy my php version is 8.0.13 "barryvdh/laravel-dompdf": "0.8.7", "laravel/framework": "^8.12",
running on local APP_ENV=local
How did you replicate this?
This is only a wrapper, that issue must be on dompdf/dompdf
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any issues with PDF rendering itself that are not directly related to this package, should be reported on https://github.com/dompdf/dompdf instead. When having doubts, please try to reproduce the issue with just dompdf. If you believe this is an actual issue with the latest version of laravel-dompdf, please reply to this issue so we can investigate further. Thank you for your contribution! Apologies for any delayed response on our side.
thanks is already working, it is necessary to change the vendor\dompdf\dompdf\src\Css\Style.php
function set_z_index($val) { $this->_props["z_index"] = $val; $this->_props_computed["z_index"] = null; $this->_prop_cache["z_index"] = null;
if (round($val) != $val && $val !== "auto") {
return;
}
$this->_props_computed["z_index"] = $val;
}
TO
function set_z_index($val) { $this->_props["z_index"] = $val; $this->_props_computed["z_index"] = null; $this->_prop_cache["z_index"] = null;
if($val !== "auto"){
if (round($val) != $val) {
return;
}
}
$this->_props_computed["z_index"] = $val;
}