سؤال

I am using mpdf to generate pdf in Zend Framework, but when i create object of mpdf its not creating. When i am using it in simple core php then its work fine. 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(); is not working. Why?

هل كانت مفيدة؟

المحلول

You should check the path for mpdf files and it's libraries. If still you are getting any error just report here.

نصائح أخرى

Don't use include in zend framework, namespace use to activate mpdf, then filename and function name should be same.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top