使用dompdf生成pdf时的背景位置数组

时间:2013-03-17 11:40:12

标签: php dompdf

我尝试在php中使用库dompdf生成pdf文件,但发现以下错误。

遇到PHP错误

Severity: Warning
Message: explode() expects parameter 2 to be string, array given
Filename: include/style.cls.php
Line Number: 1061

我尝试调试并发现导致错误的数组

array
  'background_position' => 
    array
      0 => string '0%' (length=2)
      'x' => string '0%' (length=2)
      1 => string '0%' (length=2)
      'y' => string '0%' (length=2)
  'background' => string 'none' (length=4)

我的问题是如何修复此错误,此数组来自何处?

感谢任何回复。

感谢, 反

1 个答案:

答案 0 :(得分:0)

您必须将background_position设置为带空格分隔符的字符串。在这里查找课程代码line 989 - begin of method