[eluser]suba[/eluser]
[quote author="rijobo" date="1262751494"]Hello,
I'm using DOmpdf for creating pdf's. the problem is that when I try to do this, I only see a white screen and nothing is saved on the server.
Does someone know what I do wrong?
My controller function:
Code:
function generatePDF() {
$this->load->plugin('pdf_plugin');
$data['navlist'] = $this-> mmateriaal-> getMateriaalNav();
// page info here, db calls, etc.
$html = $this->load->view('pdf_view', $data, true);
pdf_create($html, 'filename');
}
My view:
Code:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>AEC Ding</title>
</head>
<body>
<h3>Dit zijn de gebruikers die nu in de database staan:</h3>
Hallooooooooooooooo!
</body>
</html>
My plugin:
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
ini_set("display_errors","on");
error_reporting(E_ALL);
function pdf_create($html, $filename, $stream=FALSE)
{
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('".base_url()."/invoices_temp/invoice_$filename.pdf', $dompdf->output());
}
}
?>
[/quote]
Quote:SOLVED