0

Here am using dompdf to generate pdf file.For that i had included the code like this.. My control looks like this

<?php
require_once (APPPATH.'helpers/dompdf/autoload.inc.php');
use Dompdf\Dompdf;
$dompdf = new Dompdf();
class Account_control extends CI_Controller {
 function __construct() 
 {
  parent::__construct();       
  $this->load->model('Account_model');
  $this->load->library('num_to_words');

 }
function bill_print($id = NULL){

$this->load->helper('file');
$data['result'] = $this->Account_model->bill_print($id)->row();
$result = $data['result'];
$invoice = $result->invoice_no;
$data['products'] = $this->Account_model->get_all_products()->result();
$dompdf = New DOMPDF();
$html = $this->load->view('pdf', $data, TRUE);
$dompdf->loadHtml($html);
$dompdf->render();
$dompdf->stream("{$invoice}", array("Attachment"=>0));
}

}

am getting pdf result like this on live enter image description here

but in lcalhost am getting perfectly like this enter image description here

please help me to solve my problem

user_777
  • 845
  • 1
  • 9
  • 25

0 Answers0