I am working with DOMPDF currently, and I trying to work out why my PDF's are not being created correctly.
When I run the following 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->set_base_path($_SERVER['DOCUMENT_ROOT']);
$dompdf->output_html();
//$dompdf->load_html($html);
//$dompdf->set_paper("a4", "portrait" );
//$dompdf->render();
//$dompdf->stream($filename . ".pdf");
}
?>
In my browser I see the PDF content that I expect to be generated, however if I run this 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->set_base_path($_SERVER['DOCUMENT_ROOT']);
//$dompdf->output_html();
$dompdf->load_html($html);
$dompdf->set_paper("a4", "portrait" );
$dompdf->render();
$dompdf->stream($filename . ".pdf");
}
?>
I get no repsonse, where I would be expecting to get a download window. Is there a reason for this, I wonder if poorly formatted HTML could the problem?
Your CI plugin code should work on 1.7.x. Here's mind for your reference: