如何使用mpdf实现malayalam字体Meera以生成pdf

时间:2015-06-06 04:41:17

标签: php codeigniter mpdf

在我的函数中,在mpdf-> confing_cp.php中添加了以下代码

CASE "meera":  $unifonts = "meera,meeraI";  break;

还在mpdf-> config_font.php

中添加了以下代码
"meera" => array(
        'R' => "Meera.ttf",                     
        ),

在我的控制器中我也需要lanscape视图,所以以下是我的控制器中的代码来生成pdf

`

function export_pdf() {
            $this->data['admin_page_title'] = 'Script'; 
            $this->data['portrite'] = $this->input->post('formate');    
            this->data['script_pdf']=$this->Script_model->get_selected();
            ini_set('memory_limit','250M');     
            $html = $this->load->view('admin/script/pdf_view', $this->data,true);
            //include_once APPPATH.'/third_party/mpdf/mpdf.php';    
            $this->load->library('pdf');
            $pdf = $this->pdf->load();
            $pdf = new mPDF('ml', 'A4');          
            $pdf->AddFont('meera','','meera.ttf',true);
            $pdf->SetFont('meera','',14);
            if($this->data['portrite']=="landscape") {
            $pdf=new mPDF('utf-8', 'A4-L');
             }
          // $pdf->SetAutoFont(AUTOFONT_ALL);
         //  $pdf->setHTMLFooter($footer);
            $pdf->WriteHTML($html);
           $pdf->Output();
            exit;`
         }`

0 个答案:

没有答案