我使用dompdf创建了一个PDF文件,该文件被创建为即时创建的PDF文件,其唯一目的是作为PDF生成器的输入,但是我遇到了麻烦这一点,我实现了代码this thread,一切工作正常(我可以输出一个简单的PDF),但是当我尝试给它一个更具体的网址我得到这个错误:使用CodeIgniter生成PDF
An Error Was Encountered Unable to load the requested file
下面是有问题的代码:
function printPDF(){
//write_file() usa un helper (file)
$this->load->library('table');
$this->load->plugin('to_pdf');
// page info here, db calls, etc.
$query = $this->db->get('producto');
$data['table'] = $this->table->generate($query);
$path_url = base_url().'print/existencias.html';
write_file($path_url, $data['table']);
$html = $this->load->view($path_url, 'consulta', true);
pdf_create($html, 'consulta');
}
在这里你可以找到很好的库 http://stackoverflow.com/questions/9707967/convert-htmlcss-to-pdf-using-codeigniter – Buddhi 2012-10-03 12:23:40