linea21-externals
[ class tree: linea21-externals ] [ index: linea21-externals ] [ all elements ]

Source for file BarcodeObject

Documentation is available at BarcodeObject

  1. <?php
  2. //============================================================+
  3. // File name   : image.php
  4. // Begin       : 2002-07-31
  5. // Last Update : 2005-01-08
  6. // Author      : Karim Mribti [barcode@mribti.com]
  7. //             : Nicola Asuni [info@tecnick.com]
  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 linea21.externals
  29.  * @subpackage com.tecnick.tcpdf
  30.  * @version 0.0.8a  2001-04-01 (original code)
  31.  * @since 2001-03-25
  32.  * @license http://www.gnu.org/copyleft/lesser.html LGPL
  33.  */
  34.  
  35. /**
  36.  * 
  37.  */
  38.  
  39. require("../../shared/barcode/barcode.php");
  40. require("../../shared/barcode/i25object.php");
  41. require("../../shared/barcode/c39object.php");
  42. require("../../shared/barcode/c128aobject.php");
  43. require("../../shared/barcode/c128bobject.php");
  44. require("../../shared/barcode/c128cobject.php");
  45.  
  46. if (!isset($_REQUEST['style'])) $_REQUEST['style'BCD_DEFAULT_STYLE;
  47. if (!isset($_REQUEST['width'])) $_REQUEST['width'BCD_DEFAULT_WIDTH;
  48. if (!isset($_REQUEST['height'])) $_REQUEST['height'BCD_DEFAULT_HEIGHT;
  49. if (!isset($_REQUEST['xres'])) $_REQUEST['xres'BCD_DEFAULT_XRES;
  50. if (!isset($_REQUEST['font'])) $_REQUEST['font'BCD_DEFAULT_FONT;
  51. if (!isset($_REQUEST['type'])) $_REQUEST['type'"C39";
  52. if (!isset($_REQUEST['code'])) $_REQUEST['code'"";
  53.  
  54. switch (strtoupper($_REQUEST['type'])) {
  55.     case "I25"{
  56.         $obj new I25Object($_REQUEST['width']$_REQUEST['height']$_REQUEST['style']$_REQUEST['code']);
  57.         break;
  58.     }
  59.     case "C128A"{
  60.         $obj new C128AObject($_REQUEST['width']$_REQUEST['height']$_REQUEST['style']$_REQUEST['code']);
  61.         break;
  62.     }
  63.     case "C128B"{
  64.         $obj new C128BObject($_REQUEST['width']$_REQUEST['height']$_REQUEST['style']$_REQUEST['code']);
  65.         break;
  66.     }
  67.     case "C128C"{
  68.         $obj new C128CObject($_REQUEST['width']$_REQUEST['height']$_REQUEST['style']$_REQUEST['code']);
  69.         break;
  70.     }
  71.     case "C39":
  72.     default{
  73.         $obj new C39Object($_REQUEST['width']$_REQUEST['height']$_REQUEST['style']$_REQUEST['code']);
  74.         break;
  75.     }
  76. }
  77.  
  78. if ($obj{
  79.     $obj->SetFont($_REQUEST['font']);   
  80.     $obj->DrawObject($_REQUEST['xres']);
  81.     $obj->FlushObject();
  82.     $obj->DestroyObject();
  83.     unset($obj);  /* clean */
  84. }
  85.  
  86. //============================================================+
  87. // END OF FILE                                                 
  88. //============================================================+
  89. ?>

Documentation generated on Fri, 16 Oct 2009 09:28:36 +0200 by phpDocumentor 1.4.1