true,'DOMPDF_ENABLE_PHP'=>true,'DOMPDF_UNICODE_ENABLED' => true)); $dompdf->load_html($html); //$dompdf->setEncryption('test1234'); $dompdf->set_paper($paper, $orientation); $dompdf->set_option("isPhpEnabled", true); $dompdf->set_option("enable_font_subsetting", true); //print_r($dompdf->getOptions());die(); $dompdf->render(); $canvas = $dompdf->get_canvas(); $total = $dompdf->get_canvas()->get_page_count(); //echo $total.'TOT'; //$font = Font_Metrics::get_font("helvetica", "bold"); //$font = null; $font = $dompdf->getFontMetrics()->get_font("helvetica"); // echo "{PAGE_NUM}"; $canvas->page_text(515,760, "Page {PAGE_NUM} of {PAGE_COUNT}", $font,10, array(0,0,0)); //echo "{PAGE_NUM}"; // if($total == "{PAGE_NUM}") // { // echo "{PAGE_NUM}"; // echo $total.'TOT'; // $canvas->page_text(515,700, "Page {PAGE_COUNT} of {PAGE_COUNT}", $font,8, array(0,0,0)); // } //$canvas->get_cpdf()->setEncryption('userpass', 'ownerpass', array('print', 'copy')); //$canvas->get_cpdf()->setEncryption('userpass'); if ($stream) { $dompdf->stream($filename.".pdf", array("Attachment" => 0)); } else { return $dompdf->output(); //$output_file2 = APPPATH."/docs/sample.pdf"; //echo file_put_contents($output_file2, $dompdf->output()); // $CI =& get_instance(); // $CI->load->helper('file'); // write_file(APPPATH."/docs/sample.pdf",$dompdf->output()); } } } ?>