当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Barcode::factory方法代码示例

本文整理汇总了PHP中Zend_Barcode::factory方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Barcode::factory方法的具体用法?PHP Zend_Barcode::factory怎么用?PHP Zend_Barcode::factory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Barcode的用法示例。


在下文中一共展示了Zend_Barcode::factory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getBarcodeImgSource

 public function getBarcodeImgSource()
 {
     $type = "code128";
     $orderId = $this->getOrder()->getIncrementId();
     $barcodeOptions = array('text' => $orderId, 'fontSize' => "14", 'withQuietZones' => true);
     $rendererOptions = array();
     $imageResource = Zend_Barcode::factory($type, 'image', $barcodeOptions, $rendererOptions);
     return $imageResource;
 }
开发者ID:javik223,项目名称:Evron-Magento,代码行数:9,代码来源:Printinvoice.php

示例2: generateBarcodeAction

 public function generateBarcodeAction()
 {
     $product_code = $this->getRequest()->getParam('product_code');
     header('Content-type: image/png');
     $this->_helper->layout()->disableLayout();
     $this->_helper->viewRenderer->setNoRender();
     $barcodeOptions = array('text' => "{$product_code}", 'barHeight' => 40);
     $rendererOptions = array();
     $renderer = Zend_Barcode::factory('code128', 'image', $barcodeOptions, $rendererOptions)->render();
 }
开发者ID:sarankh80,项目名称:opsstock,代码行数:10,代码来源:IndexController.php

示例3: barcode_generate

 function barcode_generate($kode)
 {
     $houseno = $this->post('houseno');
     //$height =25;//tinggi barcode
     //$width = 3; //ketebalan barcode
     $this->load->library('zend');
     $this->zend->load('Zend/Barcode');
     $barcodeOPT = array('text' => $kode, 'barHeight' => $height, 'factor' => $width);
     $renderOPT = array();
     $render = Zend_Barcode::factory('code128', 'image', $barcodeOPT, $renderOPT)->render();
 }
开发者ID:raflesngln,项目名称:att-system,代码行数:11,代码来源:connote_print.php

示例4: set_barcode

 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());
     $barcodeOptions = array('text' => $code, 'barHeight' => 20, 'factor' => 1);
     $rendererOptions = array();
     $renderer = Zend_Barcode::factory('code128', 'image', $barcodeOptions, $rendererOptions)->render();
 }
开发者ID:projukti,项目名称:dumkal,代码行数:12,代码来源:Main.php

示例5: gambar

 function gambar($kode)
 {
     $height = 60;
     //tinggi barcode
     $width = 2;
     //ketebalan barcode
     $this->load->library('zend');
     $this->zend->load('Zend/Barcode');
     $barcodeOPT = array('text' => $kode, 'barHeight' => $height, 'factor' => $width);
     $renderOPT = array();
     $render = Zend_Barcode::factory('code128', 'image', $barcodeOPT, $renderOPT)->render();
 }
开发者ID:raflesngln,项目名称:att-system,代码行数:12,代码来源:barcode.php

示例6: generate

 public function generate($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());
     $barcodeOptions = array('text' => $code);
     $rendererOptions = array('imageType' => 'png', 'horizontalPosition' => 'center', 'verticalPosition' => 'middle');
     $imageResource = Zend_Barcode::factory('code39', 'image', $barcodeOptions, $rendererOptions)->render();
     return $imageResource;
 }
开发者ID:ailuropodagit,项目名称:tttkkk,代码行数:13,代码来源:Barcode.php

示例7: getImage

 /**
  * Return barcode image
  */
 public function getImage($barcode)
 {
     $barcodeStandard = Mage::getStoreConfig('barcodelabel/general/standard');
     // WARNING option withChecksum = false is ignored for EAN 13 ! we have to cut the barcode if ean13 is enable
     if ($barcodeStandard == "Ean13") {
         $barcode = substr($barcode, 0, 12);
     }
     $barcodeOptions = array('text' => $barcode);
     // barcode attribut (not sku!)
     $rendererOptions = array();
     // default = empty
     $factory = Zend_Barcode::factory($barcodeStandard, 'image', $barcodeOptions, $rendererOptions);
     $image = $factory->draw();
     return $image;
 }
开发者ID:xiaoguizhidao,项目名称:devfashion,代码行数:18,代码来源:BarcodePicture.php

示例8: barcode

	function barcode () {
	
		require 'Zend/Barcode.php';
		//require 'Zend/Barcode/Object/Code39.php';
		//require 'Zend/Barcode/Renderer/Image.php';
		
		$barcodeOptions = array('text' => 'ZEND-FRAMEWORK');
		$rendererOptions = array();
		
		try {
			$barcode = Zend_Barcode::factory('code39', 'image', $barcodeOptions, $rendererOptions);
		} catch (Exception $e) {
		    echo 'Caught exception: ',  $e->getMessage(), "\n";
		}
		
		print_r($barcode);
	}
开发者ID:G-LAB,项目名称:glab-cms,代码行数:17,代码来源:image.php

示例9: getimageAction

 public function getimageAction()
 {
     $params = $this->getRequest()->getParams();
     $type = $params['type'];
     $code = $params['text'];
     if (isset($params['customize']) && $params['customize']) {
         $heigth = $params['heigth_barcode'];
         $barcodeOptions = array('text' => $code, 'barHeight' => $heigth, 'fontSize' => $params['font_size'], 'withQuietZones' => true);
     } else {
         $barcodeOptions = array('text' => $code, 'fontSize' => $params['font_size'], 'withQuietZones' => true);
     }
     // No required options
     $rendererOptions = array();
     // Draw the barcode in a new image,
     // send the headers and the image
     $imageResource = Zend_Barcode::factory($type, 'image', $barcodeOptions, $rendererOptions);
     imagepng($imageResource->draw(), Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA) . DS . 'inventorybarcode' . DS . 'images' . DS . 'barcode' . DS . 'barcode.png');
     $imageResource->render();
 }
开发者ID:cabrerabywaters,项目名称:magentoSunshine,代码行数:19,代码来源:PrintbarcodeController.php

示例10: indexAction

 public function indexAction()
 {
     $product_id = $this->getRequest()->getParam('product_id');
     if (!isset($product_id) || !is_numeric($product_id)) {
         exit;
     }
     $eanprefix_code = '012345';
     $product = Mage::getModel('catalog/product')->load($product_id);
     $ean_code = $this->ean13_check_digit($eanprefix_code . str_pad($product->getId(), 5, "0", STR_PAD_LEFT));
     //var_dump($ean_code);die();
     include_once Mage::getBaseDir('lib') . 'Zend/Barcode.php';
     $barcodeOptions = array('text' => $ean_code);
     $rendererOptions = array();
     try {
         $renderer = Zend_Barcode::factory('ean13', 'image', $barcodeOptions, $rendererOptions)->render();
     } catch (Exception $e) {
     }
     exit;
 }
开发者ID:bogdy2p,项目名称:apstufgnto,代码行数:19,代码来源:BarcodeController.php

示例11: testFactoryWithExistingBarcodeObject

 public function testFactoryWithExistingBarcodeObject()
 {
     $this->_checkGDRequirement();
     $barcode = new Zend_Barcode_Object_Code25();
     $renderer = Zend_Barcode::factory($barcode);
     $this->assertSame($barcode, $renderer->getBarcode());
 }
开发者ID:omusico,项目名称:logica,代码行数:7,代码来源:FactoryTest.php

示例12: gerarcodigodebarrasAction

 public function gerarcodigodebarrasAction()
 {
     //$this->_helper->layout->disableLayout();
     $pronac = $_GET['pronac'];
     $barcodeOptions = array('text' => $pronac);
     $rendererOptions = array();
     $codigo = Zend_Barcode::factory('code39', 'image', $barcodeOptions, $rendererOptions)->draw();
     copy($codigo, 'D:/imagem');
     //xd($codigo);
 }
开发者ID:hackultura,项目名称:novosalic,代码行数:10,代码来源:GerenciarparecertecnicoController.php

示例13: isset

    require_once LIB . 'Zend/Barcode.php';
    $act = isset($get->act) ? trim($get->act) : 'save';
    $output = isset($get->output) ? trim($get->output) : 'image';
    $ext = $output == 'image' ? $mode : 'pdf';
    $file_name = '../../images/barcodes/' . $code . '.' . $ext;
    $options = array('text' => $code);
    //$options['barHeight'] = 50;
    //$options['barThickWidth'] = 3;
    //$options['barThinWidth'] = 1;
    $options['factor'] = $scale;
    //$options['foreColor'] = "#000000";
    //$options['backgroundColor'] = "#FFFFFF";
    //$options['reverseColor'] = FALSE;
    //$options['orientation'] = 0;
    $options['font'] = "./DejaVuSans.ttf";
    //$options['fontSize'] = 10;
    //$options['withBorder'] = FALSE;
    //$options['withQuietZones'] = TRUE;
    //$options['drawText'] = TRUE;
    //$options['stretchText'] = FALSE;
    //$options['withChecksum'] = FALSE;
    //$options['withChecksumInText'] = FALSE;
    // output the barcode
    $renderer = Zend_Barcode::factory($encoding, $output, $options, array());
    if ($act == 'save') {
        call_user_func('image' . $mode, $renderer->draw(), $file_name);
    } else {
        $renderer->render();
    }
}
exit;
开发者ID:bandaaceh,项目名称:slims8_akasia,代码行数:31,代码来源:barcode.php

示例14: getBarcodeImageFile

 public function getBarcodeImageFile($text, $resultType = 'url')
 {
     $text = strtoupper($text);
     $fileName = preg_replace('/[^0-9A-Z-]/', '', $text);
     $cacheDir = Mage::getModel('core/config')->getVarDir() . self::BARCODE_CACHE_DIR;
     for ($distriDepth = 0; $distriDepth < self::BARCODE_CACHE_DISTRI_DEPTH; $distriDepth++) {
         $cacheDir .= strlen($fileName) > $distriDepth ? '/' . $fileName[$distriDepth] : '';
     }
     $cachePath = $cacheDir . DS . $fileName . '.' . self::BARCODE_IMAGE_TYPE;
     if (!file_exists($cachePath)) {
         if (!file_exists($cacheDir)) {
             mkdir($cacheDir, 0777, true);
         }
         $config = new Zend_Config(array('barcode' => 'code39', 'barcodeParams' => array('text' => $text), 'renderer' => 'image', 'rendererParams' => array('imageType' => self::BARCODE_IMAGE_TYPE)));
         $barcode = Zend_Barcode::factory($config);
         $imageFunction = 'image' . self::BARCODE_IMAGE_TYPE;
         $result = $imageFunction($barcode->draw(), $cachePath);
         if (!$result) {
             return false;
         }
     }
     switch ($resultType) {
         case 'url':
             $result = Mage::getUrl('', array('_direct' => str_replace(Mage::getBaseDir() . DS, '', $cachePath)));
             break;
         case 'magepath':
             $result = str_replace(Mage::getBaseDir() . DS, '', $cachePath);
             break;
         case 'fullpath':
         default:
             $result = $cachePath;
     }
     return $result;
 }
开发者ID:rcclaudrey,项目名称:dev,代码行数:34,代码来源:Data.php

示例15: gen_barcode

 function gen_barcode($product_code = NULL, $height = 60, $width = 210)
 {
     if ($this->input->get('code')) {
         $product_code = $this->input->get('code');
     }
     if ($this->input->get('height')) {
         $height = $this->input->get('height');
     }
     if ($this->input->get('width')) {
         $width = $this->input->get('width');
     }
     $this->load->library('zend');
     $this->zend->load('Zend/Barcode');
     //'drawText' => FALSE
     $barcodeOptions = array('text' => $product_code, 'barHeight' => $height);
     $rendererOptions = array('imageType' => 'png', 'horizontalPosition' => 'center', 'verticalPosition' => 'middle', 'width' => $width);
     $imageResource = Zend_Barcode::factory(BARCODE_SYMBOLOGY, 'image', $barcodeOptions, $rendererOptions)->render();
     return $imageResource;
 }
开发者ID:hernanj,项目名称:SistemaViesma,代码行数:19,代码来源:products.php


注:本文中的Zend_Barcode::factory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。