i want to generate barcode in my codeigniter application, when i include Zend libraries and rendered barcode its not rendered and its give error that
The image ...cannot displayed its contain errors
when i use same code and libraries in new codeigniter project its works properly and generate barcode successfully.
Why this happens?
My code is:
function gen_barcode()
{
//I'm just using rand() function for data example
$temp = rand(10000, 99999);
$this->set_barcode($temp);
}
private function set_barcode($code)
{
//load library
$this->load->library('zend');
//load in folder Zend
$this->zend->load('Zend/Barcode');
////generate barcode
Zend_Barcode::render('code128', 'image', array('text'=>$code), array());
}
See Question&Answers more detail:os