【发布时间】:2019-01-26 12:53:22
【问题描述】:
我正在传递值以在 laravel 控制器中打印 pdf。在本地机器上它工作得很好,但在实时服务器上它显示“遇到非数字值”错误。
我使用 barrvdh dom pdf 打印 pdf
【问题讨论】:
我正在传递值以在 laravel 控制器中打印 pdf。在本地机器上它工作得很好,但在实时服务器上它显示“遇到非数字值”错误。
我使用 barrvdh dom pdf 打印 pdf
【问题讨论】:
在使用 PHP 7.1 或更高版本的系统上运行 Dompdf 版本
确保您使用的是 Laravel-Dompdf 0.8.0 或更高版本 (releases)。
【讨论】:
我遇到了同样的问题,并通过以下解决方案解决了第 436 行的“cellmap.cls.php”
/**Old Code:**/
// Determine where this cell is going
$colspan = $node->getAttribute("colspan");
$rowspan = $node->getAttribute("rowspan");
if ( !$colspan ) {
$colspan = 1;
$node->setAttribute("colspan",1);
}
if ( !$rowspan ) {
$rowspan = 1;
$node->setAttribute("rowspan",1);
}
/**New Code:**/
if(method_exists($node,'getAttribute')){
// Determine where this cell is going
$colspan = $node->getAttribute("colspan");
$rowspan = $node->getAttribute("rowspan");
if ( !$colspan ) {
$colspan = 1;
$node->setAttribute("colspan",1);
}
if ( !$rowspan ) {
$rowspan = 1;
$node->setAttribute("rowspan",1);
}
}
【讨论】: