2015-11-14 72 views
1

我想使用Mpdf工具將我的內容打印到PDF。該代碼在本地主機工作,但是當我厭倦了相同的代碼在服務器它不工作給一些eroor「mPDF錯誤:一些數據已經輸出到瀏覽器,無法發送PDF文件」。無法打印PDF(MPDF)

我的代碼是:

<?php 




    $address = "banglore rt nagar"; 

    $template_data = " hello this is test ##ADDRESS## adress"; 

    $template_data = str_replace('##ADDRESS##', $address , $template_data); 


    ob_end_clean(); 

    include 'MPDF57/mpdf.php'; 



     $mpdf=error_reporting(E_STRICT); 
     $mpdf=new mPDF('win-1252','A4','','',15,10,16,10,10,10); 
     $mpdf->Bookmark('Start of the document'); 
     $mpdf->SetDisplayMode('fullpage'); 
     $mpdf->WriteHTML($template_data); 
     $mpdf->Output(); 

     exit(); 


     ?> 

我已經試過很多解決方案。但沒有什麼效果。任何幫助?

回答