MDPF 库生成空白页..即使我设置调试模式也没有错误

发布于 2024-11-24 04:14:18 字数 1269 浏览 0 评论 0原文

我正在使用 mpdf 库,它在文件夹中单独工作完美服务器,但如果我在我的应用程序中包含 mpdf 库,那么它会输出一个空白页面。如果我通过 firebug 看到 HTML,那么

<html>
       <head></head>
       <body></body>
</html>

下面显示的是我的页面代码

session_start();
error_reporting(-1);    
//include files and mpdf library

$id=(int)$_GET['id'];
//some mysql query and and

$html = "<div id=\"print_target_box\" style=\"display:block;\">";
// some php mysql manipulations
$html .="<b>..</b>
<strong>...</strong><br/>";
// many div and block concatenate by  $html.="";

$html .="</div>";  
$mpdf = new mPDF(); 
$mpdf->debug = true;
$mpdf->WriteHTML($html);
$mpdf->Output();
exit;

echo phpinfo();

zlib 部分返回

Directive   Local Value Master Value
zlib.output_compression Off Off
zlib.output_compression_level   -1  -1
zlib.output_handler no value    no value

,依此类推...

我还阅读了此链接

http://mpdf.bpm1.com/forum/comments.php?DiscussionID=121

i am using mpdf library, it works perfect individuall in an folder on server, but if i include mpdf library in my application, then it output a blank page. if i see the HTML via firebug then display

<html>
       <head></head>
       <body></body>
</html>

below is my page code

session_start();
error_reporting(-1);    
//include files and mpdf library

$id=(int)$_GET['id'];
//some mysql query and and

$html = "<div id=\"print_target_box\" style=\"display:block;\">";
// some php mysql manipulations
$html .="<b>..</b>
<strong>...</strong><br/>";
// many div and block concatenate by  $html.="";

$html .="</div>";  
$mpdf = new mPDF(); 
$mpdf->debug = true;
$mpdf->WriteHTML($html);
$mpdf->Output();
exit;

echo phpinfo();

returns under zlib section

Directive   Local Value Master Value
zlib.output_compression Off Off
zlib.output_compression_level   -1  -1
zlib.output_handler no value    no value

and so on...

i also read this link

http://mpdf.bpm1.com/forum/comments.php?DiscussionID=121

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

腹黑女流氓 2024-12-01 04:14:20

服务器上缺少一张图像 `go.gif,并且不会显示错误
bcoz error_reporting 在下面包含的 php 页面中设置为 0

如果您编辑文件 mpdf.php 并在以下位置找到包含该错误消息的行it:

if (!$im) { return $this->_imageError($file, $firsttime, 
    'Error parsing image file - image type not recognised,
      and not supported by GD imagecreate'); }

将其更改为:

if (!$im) { echo $data; exit; }

它可能会显示出了什么问题。

参考:
http://mpdf.bpm1.com/forum/comments.php?DiscussionID=235

one image `go.gif was missing on server and this does not displaying error
bcoz error_reporting was set to 0 in below included php page..

If you edit file mpdf.php and find the line with that error message in it:

if (!$im) { return $this->_imageError($file, $firsttime, 
    'Error parsing image file - image type not recognised,
      and not supported by GD imagecreate'); }

change this to:

if (!$im) { echo $data; exit; }

it may show what is going wrong.

reference:
http://mpdf.bpm1.com/forum/comments.php?DiscussionID=235

爱已欠费 2024-12-01 04:14:20

就我而言,问题是缺少mbregex。生成错误的行是@command,这对于调试未知的东西来说非常有用。

In my case the problem was missing mbregex. Line that generates the error is @command, which is just fabulous for debugging unknown stuff.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文