private function _render(){
        $textColor = new CINColor($this->foregroundColor);
        $backgroudColor = new CINColor($this->backgroundColor);
        
        /* Here is the list of the arguments
        1 - Filename (empty : display on screen)
        2 - Background color */
        $drawing = new CINDrawing($this->filename, $backgroudColor);
        
        $drawException = null;
        
        if(isset($this->format) and !in_array(strtoupper($this->format), $this->allowedFormats)){
            $drawException = $this->format .' format is not allowed.';
        }
        
        if(!isset($this->barcodeType)){
            $drawException = 'Unable to generate barcode for unknown type';
        }else{
            try{
                if(!($code = $this->_getCode())){
                    $drawException = 'Unable to generate barcode';
                }
            } catch(\Exception $e){
                $drawException = $e->getMessage();
            }
        }

        ob_start();
        if($drawException) {
            $exception = new \Exception($drawException);
            $drawing->drawException($exception);
        } else {
            $drawing->setBarcode($code);
            $drawing->draw();
        }
        $drawing->finish($this->_getFormat());
        $barcodeImg = ob_get_clean();
        $barcodeImg = base64_encode($barcodeImg);
        return $barcodeImg;
    }
private function _render(){
        $textColor = new CINColor($this->foregroundColor);
        $backgroudColor = new CINColor($this->backgroundColor);
        
        /* Here is the list of the arguments
        1 - Filename (empty : display on screen)
        2 - Background color */
        $drawing = new CINDrawing($this->filename, $backgroudColor);
        
        $drawException = null;
        
        if(isset($this->format) and !in_array(strtoupper($this->format), $this->allowedFormats)){
            $drawException = $this->format .' format is not allowed.';
        }
        
        if(!isset($this->barcodeType)){
            $drawException = 'Unable to generate barcode for unknown type';
        }else{
            try{
                if(!($code = $this->_getCode())){
                    $drawException = 'Unable to generate barcode';
                }
            } catch(\Exception $e){
                $drawException = $e->getMessage();
            }
        }

        ob_start();
        if($drawException) {
            $exception = new \Exception($drawException);
            $drawing->drawException($exception);
        } else {
            $drawing->setBarcode($code);
            $drawing->draw();
        }
        $drawing->finish($this->_getFormat());
        $barcodeImg = ob_get_clean();
        $barcodeImg = base64_encode($barcodeImg);
        return $barcodeImg;
    }
private function _render ( ) { $ textColor = new CINColor ( $ this -> foregroundColor ) ; $ backgroudColor = new CINColor ( $ this -> backgroundColor ) ; /* Here is the list of the arguments
        1 - Filename (empty : display on screen)
        2 - Background color */ $ drawing = new CINDrawing ( $ this -> filename , $ backgroudColor ) ; $ drawException = null ; if ( isset ( $ this -> format ) and ! in_array ( strtoupper ( $ this -> format ) , $ this -> allowedFormats ) ) { $ drawException = $ this -> format . ' format is not allowed.' ; } if ( ! isset ( $ this -> barcodeType ) ) { $ drawException = 'Unable to generate barcode for unknown type' ; } else { try { if ( ! ( $ code = $ this -> _getCode ( ) ) ) { $ drawException = 'Unable to generate barcode' ; } } catch ( \ Exception $ e ) { $ drawException = $ e -> getMessage ( ) ; } } ob_start ( ) ; if ( $ drawException ) { $ exception = new \ Exception ( $ drawException ) ; $ drawing -> drawException ( $ exception ) ; } else { $ drawing -> setBarcode ( $ code ) ; $ drawing -> draw ( ) ; } $ drawing -> finish ( $ this -> _getFormat ( ) ) ; $ barcodeImg = ob_get_clean ( ) ; $ barcodeImg = base64_encode ( $ barcodeImg ) ; return $ barcodeImg ; }
Render barcode as base64 encoded
@return string   Base64Encoded image
Render barcode as base64 encoded