<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
function pdf_create($html, $filename, $stream=true)
{
    require_once("dompdf/dompdf_config.inc.php");
    //$old_limit = ini_set("memory_limit", "256M");
     ini_set('memory_limit', "256M");
    
    $dompdf = new DOMPDF();
    $dompdf->load_html($html);
    $dompdf->set_paper("A4", "portrait" );
    $dompdf->render();
if($stream == true)
    $dompdf->stream($filename . ".pdf");
  else
        $dompdf->stream($filename, array("Attachment" => false));
}


?>