我正在尝试使用dompdf生成PDF文件。
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Dompdf_test extends CI_Controller {
public function index() {
// Load all views as normal
//$this->load->view('phptopdfexample');
$this->all_movements();
// Get output html
$html = $this->output->get_output();
// Load library
$this->load->library('dompdf_gen');
// Convert to PDF
$this->dompdf->load_html($html);
$this->dompdf->render();
$min = 1;
$max = 1000;
$name = rand($min, $max);
$this->dompdf->stream($name . '.pdf');
}
public function all_movements() {
$data['stocks'] = $this->inventory->getdepartmentalmovements();
$data['meds'] = $this->inventory->get_meds();
$this->load->view('deptartmental_issue_pdf', $data);
}
}
当我运行脚本时,出现了内部服务器错误,并显示以下错误信息: 遇到 PHP 错误 严重性:警告 消息:非法字符串偏移量“hex” 文件名:include/style.cls.php 行号:1422 如何解决这个问题?