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

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -