Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/235.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何使用dompdf和codeigniter在生成的PDF中显示阿拉伯语?_Php_Codeigniter - Fatal编程技术网

Php 如何使用dompdf和codeigniter在生成的PDF中显示阿拉伯语?

Php 如何使用dompdf和codeigniter在生成的PDF中显示阿拉伯语?,php,codeigniter,Php,Codeigniter,我已将库dompdf上载到我的项目,以生成阿拉伯语的PDF报告,但它无法正常工作这是我的控制器: public function payslip_details($year, $month, $payslip_type, $payslip_no) { **$this->load->library('pdf');** if (isset($_SESSION['logged_in']) && $_SESSION['logged_in'] === true

我已将库dompdf上载到我的项目,以生成阿拉伯语的PDF报告,但它无法正常工作这是我的控制器:

 public function payslip_details($year, $month, $payslip_type, $payslip_no) {
    **$this->load->library('pdf');**
    if (isset($_SESSION['logged_in']) && $_SESSION['logged_in'] === true && $this->session->is_admin == 0) {
        $this->load->model('model_salary');
        $username = $this->session->username;  //$username = 3000;
        //start year decoding 
        $base64_year = strtr($year, '-_', '+/');
        $urisafe_year = $this->encrypt->decode($base64_year);
        $year_dec = substr($urisafe_year, 0, 4);
        //start month decoding 
        $base64_month = strtr($month, '-_', '+/');
        $urisafe_month = $this->encrypt->decode($base64_month);
        if (substr($urisafe_month, 0, 2) > 9) {
            $month_dec = substr($urisafe_month, 0, 2);
        } else {
            $month_dec = substr($urisafe_month, 0, 1);
        }
        //start type decoding 
        $base64_type = strtr($payslip_type, '-_', '+/');
        $urisafe_type = $this->encrypt->decode($base64_type);
        $type_dec = substr($urisafe_type, 0, 1);
        //start number decoding 
        $base64_number = strtr($payslip_no, '-_', '+/');
        $urisafe_number = $this->encrypt->decode($base64_number);
        $number_dec = substr($urisafe_number, 0, 1);
        // get the wages object
        $data['wages'] = $this->model_salary->getWages($username, $year_dec, $month_dec, $type_dec, $number_dec);
        $data['wages_sum'] = $this->model_salary->get_wages_sum($username, $year_dec, $month_dec, $type_dec, $number_dec);
        $data['deductions'] = $this->model_salary->getDeduction($username, $year_dec, $month_dec, $type_dec, $number_dec);
        $data['deductions_sum'] = $this->model_salary->get_dudctions_sum($username, $year_dec, $month_dec, $type_dec, $number_dec);
        $data['employee_info'] = $this->model_salary->get_employee_info($username);
        $data['payslip_info'] = $this->model_salary->get_payslip_info($year_dec, $month_dec, $type_dec, $number_dec);
        $data['payslip_type'] = $type_dec;
        $data['payslip_not_notes'] = $this->model_salary->get_payslip_no_in_notes($year_dec, $month_dec, $type_dec, $number_dec, $username);
        $data['payslip_notes'] = $this->model_salary->get_payslip_notes($year_dec, $month_dec, $type_dec, $number_dec);
        $this->load->view('includes/v_template_ess_start');
        $this->pdf->load_view('user/v_payslip_details',$data);
        $this->pdf->render();
        $this->pdf->stream("user/v_payslip_details.pdf",$data);
        $this->load->view('user/v_payslip_details', $data);
        $this->load->view('includes/v_template_ess_end');
    } else {
        redirect('/ess/error');
    }
}
它会生成一个PDF文件,但类似于: