public function getBillPrint($id = '') { require_once APPPATH . 'libraries/Numbertowords.php'; $this->chkloginuser(); $id = $this->input->get('id'); //echo $id;die(); $this->load->model('mbill'); $res = $this->mbill->getBill($id); $res1 = $this->mbill->getcus($id); //print_r($res1);die(); //$this->load->view('vbillPrint',array('res'=>$res)); $html = $this->load->view('vbillPrint', array('dataBill' => $res, 'dataCustomer' => $res1), true); require_once APPPATH . 'third_party/html2pdf.class.php'; //$app=APPPATH; //echo($app);die(); try { $html2pdf = new HTML2PDF('P', 'A4', 'fr'); $html2pdf->writeHTML($html, isset($_GET['vuehtml'])); $pagecnt = $html2pdf->getPageCount(); $html = $this->load->view('vbillPrint', array('dataBill' => $res, 'dataCustomer' => $res1, 'enclose' => true, 'pagecnt' => $pagecnt), true); $html2pdf1 = new HTML2PDF('P', 'A4', 'fr'); //$html2pdf1 = $this->addTTFfont('\\DDP-IT-07\xampp\htdocs\kannadamma\application\helpers\mpdf\ttfonts', 'TrueTypeUnicode', '', 32); //$html2pdf1->setDefaultFont("dejavusans"); $html2pdf1->setDefaultFont("dejavusans"); $html2pdf1->writeHTML($html, isset($_GET['vuehtml'])); //$html2pdf1->setDefaultFont("dejavusans"); //$html2pdf1->setDefaultFont("dejavusans"); $html2pdf1->Output('gc.pdf'); // generates pdf } catch (HTML2PDF_exception $e) { echo $e; exit; } }