这里使用dompdf生成pdf文件。因为我已经包含了这样的代码.. 我的控件看起来像这样
<?php
require_once (APPPATH.'helpers/dompdf/autoload.inc.php');
use Dompdf\Dompdf;
$dompdf = new Dompdf();
class Account_control extends CI_Controller {
function __construct()
{
parent::__construct();
$this->load->model('Account_model');
$this->load->library('num_to_words');
}
function bill_print($id = NULL){
$this->load->helper('file');
$data['result'] = $this->Account_model->bill_print($id)->row();
$result = $data['result'];
$invoice = $result->invoice_no;
$data['products'] = $this->Account_model->get_all_products()->result();
$dompdf = New DOMPDF();
$html = $this->load->view('pdf', $data, TRUE);
$dompdf->loadHtml($html);
$dompdf->render();
$dompdf->stream("{$invoice}", array("Attachment"=>0));
}
}
请帮我解决我的问题