當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Barcode類代碼示例

本文整理匯總了PHP中Zend_Barcode的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Barcode類的具體用法?PHP Zend_Barcode怎麽用?PHP Zend_Barcode使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Zend_Barcode類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: save_barcode

 public function save_barcode($text = NULL, $bcs = 'code39', $height = 56, $stext = 1, $width = 256)
 {
     $drawText = $stext != 1 ? FALSE : TRUE;
     $this->load->library('zend');
     $this->zend->load('Zend/Barcode');
     $barcodeOptions = array('text' => $text, 'barHeight' => $height, 'drawText' => $drawText);
     $rendererOptions = array('imageType' => 'png', 'horizontalPosition' => 'center', 'verticalPosition' => 'middle');
     //'width' => $width
     $image = Zend_Barcode::draw($bcs, 'image', $barcodeOptions, $rendererOptions);
     //header ('Content-type: image/png');
     if (imagepng($image, 'assets/uploads/barcode' . $this->session->userdata('user_id') . '.png')) {
         imagedestroy($image);
         $bc = file_get_contents('assets/uploads/barcode' . $this->session->userdata('user_id') . '.png');
         $bcimage = base64_encode($bc);
         return $bcimage;
     }
     return FALSE;
 }
開發者ID:NimzyMaina,項目名稱:sma,代碼行數:18,代碼來源:Sma.php

示例2: set_barcode

 private function set_barcode($code)
 {
     $this->load->library('Zend');
     $this->zend->load('Zend/Barcode');
     //generate barcode
     Zend_Barcode::render('code128', 'image', array('text' => $code), array());
 }
開發者ID:heruprambadi,項目名稱:barcode,代碼行數:7,代碼來源:Barcode.php

示例3: zend

 public function zend()
 {
     $this->load->library('library_zend');
     $test = Zend_Barcode::draw('ean8', 'image', array('text' => 'abc123'), array());
     //var_dump($test);
     imagejpeg($test, 'temp/' . uniqid() . '.jpg', 100);
 }
開發者ID:crodriguezn,項目名稱:crossfit-milagro,代碼行數:7,代碼來源:test001.php

示例4: 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

示例5: set_barcode

 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());
 }
開發者ID:DeRossi,項目名稱:Training_CI,代碼行數:9,代碼來源:Barcode.php

示例6: set_bar

 private function set_bar($text)
 {
     $this->load->library('zend');
     $this->zend->load('Zend/Barcode');
     /*$barcodeOptions = array('text' => $text);
     		$rendererOptions = array();
     		Zend_Barcode::factory('code39', 'image', $barcodeOptions, $rendererOptions)->render();*/
     Zend_Barcode::render('code128', 'image', array('text' => $text), array());
 }
開發者ID:virbo,項目名稱:ci_barcode,代碼行數:9,代碼來源:Welcome.php

示例7: barcode

 public function barcode()
 {
     $code = $this->uri->segment(3, 0);
     //load library
     //load in folder Zend
     $this->zend->load('Zend/Barcode');
     //generate barcode
     $barcode = Zend_Barcode::render('code128', 'image', array('text' => $code), array());
 }
開發者ID:jishnuvyala,項目名稱:lis,代碼行數:9,代碼來源:card.php

示例8: barcode

 private function barcode()
 {
     $code = $this->uri->segment(3, 0);
     //load library
     $this->load->library('zend');
     //load in folder Zend
     $this->zend->load('Zend/Barcode');
     //generate barcode
     Zend_Barcode::render('code39', 'image', array('text' => $code), array());
 }
開發者ID:jishnuvyala,項目名稱:lis,代碼行數:10,代碼來源:test.php

示例9: 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

示例10: barcodeAction

 /**
  * This can be used to generate barcodes, use the action
  *
  * /openrosa/barcode/code/<tokenid>
  *
  * example:
  * /openrosa/barocde/code/22pq-grkq
  *
  * The image will be a png
  */
 public function barcodeAction()
 {
     $code = $this->getRequest()->getParam('code', 'empty');
     \Zend_Layout::getMvcInstance()->disableLayout();
     $this->_helper->viewRenderer->setNoRender();
     $barcodeOptions = array('text' => $code);
     $rendererOptions = array();
     $barcode = \Zend_Barcode::render('code128', 'image', $barcodeOptions, $rendererOptions);
     $barcode->render();
 }
開發者ID:GemsTracker,項目名稱:gemstracker-library,代碼行數:20,代碼來源:OpenrosaAction.php

示例11: 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

示例12: barcode

 function barcode($code)
 {
     // We load her library's reading Zend.php file that contains the loader
     // For existing files in the folder Zend
     $this->load->library('zend');
     // Load that is in a folder Zend
     $this->zend->load('Zend/Barcode');
     // Generate barcodenya
     // $ Code = 12345abc;
     Zend_Barcode::render('code128', 'image', array('text' => $code), array());
 }
開發者ID:VNOME,項目名稱:lims_new,代碼行數:11,代碼來源:new_test_request_controller.php

示例13: genBarcode

 public function genBarcode($txt = '', $devMode = false)
 {
     $txt = $devMode ? 'Test Generate Barcode' : $txt;
     $this->CI->load->library('zend');
     $this->CI->zend->load('Zend/Barcode');
     $barcodeOption = array('text' => $txt, 'barHeight' => 30, 'font' => 2);
     $renderOption = array('');
     $render = Zend_Barcode::render('code128', 'image', $barcodeOption, $renderOption);
     return $render;
     //exit;
 }
開發者ID:Nirun,項目名稱:HAsong01ha,代碼行數:11,代碼來源:Util.php

示例14: testDrawWithExistantResourceReturnResource

 public function testDrawWithExistantResourceReturnResource()
 {
     Zend_Barcode::setBarcodeFont(dirname(__FILE__) . '/../Object/_fonts/Vera.ttf');
     $barcode = new Zend_Barcode_Object_Code39(array('text' => '0123456789'));
     $this->_renderer->setBarcode($barcode);
     $pdfResource = new Zend_Pdf();
     $this->_renderer->setResource($pdfResource);
     $resource = $this->_renderer->draw();
     $this->assertTrue($resource instanceof Zend_Pdf);
     $this->assertSame($resource, $pdfResource);
     Zend_Barcode::setBarcodeFont('');
 }
開發者ID:jsnshrmn,項目名稱:Suma,代碼行數:12,代碼來源:PdfTest.php

示例15: 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


注:本文中的Zend_Barcode類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。