php - Generating a PDF using CodeIgniter -
i using dompdf create pdf file out of html file gets created on-the-fly sole purpose of serving input pdf generator, having trouble doing this, implemented code in this thread , works fine (i output simple pdf) when try give more specific url error:
an error encountered unable load requested file
here's code has problem:
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'); }
not sure exact problem, please check this:
1) stated in ci's manual, load->view's second parameter should associative array or objet, translated vars via extract. may generate problem generating $html.
2) try making $path_url relative application/views directory, read in ci's manual.
Comments
Post a Comment