简体   繁体   English

mpdf在zend框架中不起作用

[英]mpdf is not working in zend framework

I am using mpdf to generate pdf in Zend Framework, but when i create object of mpdf its not creating. 我正在使用mpdf在Zend Framework中生成pdf,但是当我创建mpdf的对象时却没有创建。 When i am using it in simple core php then its work fine. 当我在简单的核心php中使用它时,它的工作正常。 Please provide me a solution. 请给我一个解决方案。 here is my code: 这是我的代码:

    $html ='<table border="1" style="border-collapse:collapse;">';
    for($i=0;$i<100;$i++){
    $html .='<tr>
        <td style="height:50px">
            hi
        </td>
        <td>
            hello
        </td>
    </tr>';
    }
    $html .='</table>';
    include("mpdf/mpdf.php");
    $mpdf=new mPDF('c','A4','','',32,25,27,25,16,13);
    $mpdf->setHeader('WELCOME TO MY WORLD') ;
    $mpdf->setFooter('{PAGENO}') ;
    $mpdf->WriteHTML($html,2);
    $mpdf->Output('mpdf.pdf','I');
    exit;

$mpdf=new mPDF(); $ mpdf =新的mPDF(); is not working. 不管用。 Why? 为什么?

You should check the path for mpdf files and it's libraries. 您应该检查mpdf文件及其库的路径。 If still you are getting any error just report here. 如果仍然遇到任何错误,请在此处报告。

不要在zend框架中使用include,在激活mpdf的命名空间中使用,那么文件名和函数名应该相同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM