[eluser]rijobo[/eluser]
When I use DomPDF with this controller:
Code:
function pdf(){
$data['title'] = "Welkom in de webwinkel van Simo-Edelsmid";
$data['navlist'] = $this-> mmateriaal-> getMateriaalNav();
$data['main'] = 'home';
$data['mainf'] = $this-> mproducts-> getMainFeature2();
$data['foto_teller'] = '1';
$data['foto_regel'] = '3';
$this-> load-> vars($data);
$html = $this->load->view('test', $data, true);
pdf_create($html, 'filename');
}
and this plugin:
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
function pdf_create($html, $filename, $stream=TRUE)
{
require_once("dompdf/dompdf_config.inc.php");
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
if ($stream) {
$dompdf->stream($filename.".pdf");
} else {
$CI =& get_instance();
$CI->load->helper('file');
write_file("./invoices_temp/invoice_$filename.pdf", $dompdf->output());
}
}
?>
It shows the pdf on screen in html I think. It doesn't save the pdf in a file.
How can this happen?