[ Index ]

PHP Cross Reference of vtigercrm-6.1.0

title

Body

[close]

/libraries/tcpdf/barcode/ -> image.php (source)

   1  <?php
   2  //============================================================+
   3  // File name   : image.php
   4  // Begin       : 2002-07-31
   5  // Last Update : 2005-01-08
   6  // Author      : Karim Mribti [[email protected]]
   7  //             : Nicola Asuni [[email protected]]
   8  // Version     : 0.0.8a  2001-04-01 (original code)
   9  // License     : GNU LGPL (Lesser General Public License) 2.1
  10  //               http://www.gnu.org/copyleft/lesser.txt
  11  // Source Code : http://www.mribti.com/barcode/
  12  //
  13  // Description : Barcode Image Rendering.
  14  //
  15  // NOTE:
  16  // This version contains changes by Nicola Asuni:
  17  //  - porting to PHP5
  18  //  - code style and formatting
  19  //  - automatic php documentation in PhpDocumentor Style
  20  //    (www.phpdoc.org)
  21  //  - minor bug fixing
  22  //============================================================+
  23  
  24  /**
  25   * Barcode Image Rendering.
  26   * @author Karim Mribti, Nicola Asuni
  27   * @name BarcodeObject
  28   * @package com.tecnick.tcpdf
  29   * @version 0.0.8a  2001-04-01 (original code)
  30   * @since 2001-03-25
  31   * @license http://www.gnu.org/copyleft/lesser.html LGPL
  32   */
  33  
  34  /**
  35   * 
  36   */
  37  
  38  require("../../shared/barcode/barcode.php");
  39  require("../../shared/barcode/i25object.php");
  40  require("../../shared/barcode/c39object.php");
  41  require("../../shared/barcode/c128aobject.php");
  42  require("../../shared/barcode/c128bobject.php");
  43  require("../../shared/barcode/c128cobject.php");
  44  
  45  if (!isset($_REQUEST['style'])) $_REQUEST['style'] = BCD_DEFAULT_STYLE;
  46  if (!isset($_REQUEST['width'])) $_REQUEST['width'] = BCD_DEFAULT_WIDTH;
  47  if (!isset($_REQUEST['height'])) $_REQUEST['height'] = BCD_DEFAULT_HEIGHT;
  48  if (!isset($_REQUEST['xres'])) $_REQUEST['xres'] = BCD_DEFAULT_XRES;
  49  if (!isset($_REQUEST['font'])) $_REQUEST['font'] = BCD_DEFAULT_FONT;
  50  if (!isset($_REQUEST['type'])) $_REQUEST['type'] = "C39";
  51  if (!isset($_REQUEST['code'])) $_REQUEST['code'] = "";
  52  
  53  switch (strtoupper($_REQUEST['type'])) {
  54      case "I25": {
  55          $obj = new I25Object($_REQUEST['width'], $_REQUEST['height'], $_REQUEST['style'], $_REQUEST['code']);
  56          break;
  57      }
  58      case "C128A": {
  59          $obj = new C128AObject($_REQUEST['width'], $_REQUEST['height'], $_REQUEST['style'], $_REQUEST['code']);
  60          break;
  61      }
  62      case "C128B": {
  63          $obj = new C128BObject($_REQUEST['width'], $_REQUEST['height'], $_REQUEST['style'], $_REQUEST['code']);
  64          break;
  65      }
  66      case "C128C": {
  67          $obj = new C128CObject($_REQUEST['width'], $_REQUEST['height'], $_REQUEST['style'], $_REQUEST['code']);
  68          break;
  69      }
  70      case "C39":
  71      default: {
  72          $obj = new C39Object($_REQUEST['width'], $_REQUEST['height'], $_REQUEST['style'], $_REQUEST['code']);
  73          break;
  74      }
  75  }
  76  
  77  if ($obj) {
  78      $obj->SetFont($_REQUEST['font']);   
  79      $obj->DrawObject($_REQUEST['xres']);
  80      $obj->FlushObject();
  81      $obj->DestroyObject();
  82      unset($obj);  /* clean */
  83  }
  84  
  85  //============================================================+
  86  // END OF FILE                                                 
  87  //============================================================+
  88  ?>


Generated: Fri Nov 28 20:08:37 2014 Cross-referenced by PHPXref 0.7.1