当我尝试处理网址http://www.bbc.co.uk/
时,dompdf会抛出错误
fatal error: Uncaught exception 'DOMPDF_Exception' with message 'Box property calculation requires containing block width' in www\dompdf\include\block_frame_reflower.cls.php on line 171
看来有些设置还是有些bug?
答案 0 :(得分:0)
不,你只需要捕捉异常或正确设置你的东西。
try {
//Do your stuff here
} catch (Exception $e){
echo $e->message() ;
}
答案 1 :(得分:0)
DOMPDF_Exception
是Exception
类的扩展。我不确定它会吐出什么参数,但是你可以将数组转出来查看返回的内容:
try{
}catch(DOMPDF_Exception $e){
echo '<pre>',print_r($e),'</pre>';
}
在Google Code上也发现这可能会帮助您缩小范围,实际问题是:http://code.google.com/p/dompdf/issues/detail?id=244
答案 2 :(得分:0)
我相信返回消息的正确方法是
try {
//Do your stuff here
} catch (Exception $e){
echo $e->getMessage() ;
}