can anybody help me, i'm trying to use dompdf library with codeigniter. When i do it on localhost its work. But it's not work properly when my website has been uploaded. Here's the library code
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/**
* CodeIgniter PDF Library
*
* Generate PDF's in your CodeIgniter applications.
*
* @package CodeIgniter
* @subpackage Libraries
* @category Libraries
* @author Chris Harvey
* @license MIT License
* @link https://github.com/chrisnharvey/CodeIgniter-PDF-Generator-Library
*/
require_once(dirname(__FILE__) . '/dompdf-0.6.2/dompdf_config.inc.php');
class Pdf extends DOMPDF
{
/**
* Get an instance of CodeIgniter
*
* @access protected
* @return void
*/
protected function ci()
{
return get_instance();
}
/**
* Load a CodeIgniter view into domPDF
*
* @access public
* @param string $view The view to load
* @param array $data The view data
* @return void
*/
public function load_view($view, $data = array())
{
$html = $this->ci()->load->view($view, $data, TRUE);
$this->load_html($html);
}
}
this code to call create the pdf, i try to call the view only and it's work but when its called the "pdf" function, the screen is blank.
$this->load->library('pdf');
$this->pdf->load_view('mydocument', $data);
$this->pdf->render();
$this->pdf->stream("mydocument.pdf");
and this is structure of my files