com-tecnick-tcpdf
[ class tree: com-tecnick-tcpdf ] [ index: com-tecnick-tcpdf ] [ all elements ]

Class: TCPDFBarcode

Source Location: /barcodes.php

Class Overview


PHP class to creates array representations for common 1D barcodes to be used with TCPDF (http://www.tcpdf.org).


Author(s):

  • Nicola Asuni

Version:

  • 1.0.006

Variables

Methods



Class Details

[line 62]
PHP class to creates array representations for common 1D barcodes to be used with TCPDF (http://www.tcpdf.org).




Tags:

author:  Nicola Asuni
version:  1.0.006
link:  http://www.tcpdf.org
name:  TCPDFBarcode
license:  LGPL


[ Top ]


Class Variables

$barcode_array =

[line 68]



Tags:

var:  representation of barcode.
access:  protected

Type:   array


[ Top ]



Class Methods


constructor __construct [line 84]

TCPDFBarcode __construct( string $code, string $type)

This is the class constructor.

Return an array representations for common 1D barcodes:

  • $arrcode['code'] code to be printed on text label
  • $arrcode['maxh'] max bar height
  • $arrcode['maxw'] max bar width
  • $arrcode['bcode'][$k] single bar or space in $k position
  • $arrcode['bcode'][$k]['t'] bar type: true = bar, false = space.
  • $arrcode['bcode'][$k]['w'] bar width in units.
  • $arrcode['bcode'][$k]['h'] bar height in units.
  • $arrcode['bcode'][$k]['p'] bar top position (0 = top, 1 = middle)




Tags:

access:  public


Parameters:

string   $code   code to print
string   $type   type of barcode:
  • C39 : CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.
  • C39+ : CODE 39 with checksum
  • C39E : CODE 39 EXTENDED
  • C39E+ : CODE 39 EXTENDED + CHECKSUM
  • C93 : CODE 93 - USS-93
  • S25 : Standard 2 of 5
  • S25+ : Standard 2 of 5 + CHECKSUM
  • I25 : Interleaved 2 of 5
  • I25+ : Interleaved 2 of 5 + CHECKSUM
  • C128A : CODE 128 A
  • C128B : CODE 128 B
  • C128C : CODE 128 C
  • EAN2 : 2-Digits UPC-Based Extention
  • EAN5 : 5-Digits UPC-Based Extention
  • EAN8 : EAN 8
  • EAN13 : EAN 13
  • UPCA : UPC-A
  • UPCE : UPC-E
  • MSI : MSI (Variation of Plessey code)
  • MSI+ : MSI + CHECKSUM (modulo 11)
  • POSTNET : POSTNET
  • PLANET : PLANET
  • RMS4CC : RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)
  • KIX : KIX (Klant index - Customer index)
  • CODABAR : CODABAR
  • CODE11 : CODE 11
  • PHARMA : PHARMACODE
  • PHARMA2T : PHARMACODE TWO-TRACKS

[ Top ]

method barcode_c128 [line 793]

array barcode_c128( string $code, [string $type = 'B'])

C128 barcodes.

Very capable code, excellent density, high reliability; in very wide use world-wide




Tags:

return:  barcode representation.
access:  protected


Parameters:

string   $code   code to represent.
string   $type   barcode type: A, B or C

[ Top ]

method barcode_codabar [line 1480]

array barcode_codabar( string $code)

CODABAR barcodes.

Older code often used in library systems, sometimes in blood banks




Tags:

return:  barcode representation.
access:  protected


Parameters:

string   $code   code to represent.

[ Top ]

method barcode_code11 [line 1536]

array barcode_code11( string $code)

CODE11 barcodes.

Used primarily for labeling telecommunications equipment




Tags:

return:  barcode representation.
access:  protected


Parameters:

string   $code   code to represent.

[ Top ]

method barcode_code39 [line 231]

array barcode_code39( string $code, [ $extended = false], [boolean $checksum = false])

CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.

General-purpose code in very wide use world-wide




Tags:

return:  barcode representation.
access:  protected


Parameters:

string   $code   code to represent.
boolean   $checksum   if true add a checksum to the code
   $extended  

[ Top ]

method barcode_code93 [line 400]

array barcode_code93( string $code, boolean $checksum)

CODE 93 - USS-93

Compact code similar to Code 39




Tags:

return:  barcode representation.
access:  protected


Parameters:

string   $code   code to represent.
boolean   $checksum   if true add a checksum to the code

[ Top ]

method barcode_eanext [line 1181]

array barcode_eanext( string $code, [string $len = 5])

UPC-Based Extentions

2-Digit Ext.: Used to indicate magazines and newspaper issue numbers 5-Digit Ext.: Used to mark suggested retail price of books




Tags:

return:  barcode representation.
access:  protected


Parameters:

string   $code   code to represent.
string   $len   barcode type: 2 = 2-Digit, 5 = 5-Digit

[ Top ]

method barcode_eanupc [line 988]

array barcode_eanupc( string $code, [string $len = 13])

EAN13 and UPC-A barcodes.

EAN13: European Article Numbering international retail product code UPC-A: Universal product code seen on almost all retail products in the USA and Canada UPC-E: Short version of UPC symbol




Tags:

return:  barcode representation.
access:  protected


Parameters:

string   $code   code to represent.
string   $len   barcode type: 6 = UPC-E, 8 = EAN8, 13 = EAN13, 12 = UPC-A

[ Top ]

method barcode_i25 [line 729]

array barcode_i25( string $code, [boolean $checksum = false])

Interleaved 2 of 5 barcodes.

Compact numeric code, widely used in industry, air cargo Contains digits (0 to 9) and encodes the data in the width of both bars and spaces.




Tags:

return:  barcode representation.
access:  protected


Parameters:

string   $code   code to represent.
boolean   $checksum   if true add a checksum to the code

[ Top ]

method barcode_msi [line 599]

array barcode_msi( string $code, [boolean $checksum = false])

MSI.

Variation of Plessey code, with similar applications Contains digits (0 to 9) and encodes the data only in the width of bars.




Tags:

return:  barcode representation.
access:  protected


Parameters:

string   $code   code to represent.
boolean   $checksum   if true add a checksum to the code (modulo 11)

[ Top ]

method barcode_pharmacode [line 1628]

array barcode_pharmacode( string $code)

Pharmacode

Contains digits (0 to 9)




Tags:

return:  barcode representation.
access:  protected


Parameters:

string   $code   code to represent.

[ Top ]

method barcode_pharmacode2t [line 1654]

array barcode_pharmacode2t( string $code)

Pharmacode two-track

Contains digits (0 to 9)




Tags:

return:  barcode representation.
access:  protected


Parameters:

string   $code   code to represent.

[ Top ]

method barcode_postnet [line 1256]

array barcode_postnet( string $code, [boolean $planet = false])

POSTNET and PLANET barcodes.

Used by U.S. Postal Service for automated mail sorting




Tags:

return:  barcode representation.
access:  protected


Parameters:

string   $code   zip code to represent. Must be a string containing a zip code of the form DDDDD or DDDDD-DDDD.
boolean   $planet   if true print the PLANET barcode, otherwise print POSTNET

[ Top ]

method barcode_rms4cc [line 1329]

array barcode_rms4cc( string $code, [boolean $kix = false])

RMS4CC - CBC - KIX RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code) - KIX (Klant index - Customer index) RM4SCC is the name of the barcode symbology used by the Royal Mail for its Cleanmail service.



Tags:

return:  barcode representation.
access:  protected


Parameters:

string   $code   code to print
boolean   $kix   if true prints the KIX variation (doesn't use the start and end symbols, and the checksum) - in this case the house number must be sufficed with an X and placed at the end of the code.

[ Top ]

method barcode_s25 [line 658]

array barcode_s25( string $code, [boolean $checksum = false])

Standard 2 of 5 barcodes.

Used in airline ticket marking, photofinishing Contains digits (0 to 9) and encodes the data only in the width of bars.




Tags:

return:  barcode representation.
access:  protected


Parameters:

string   $code   code to represent.
boolean   $checksum   if true add a checksum to the code

[ Top ]

method binseq_to_array [line 699]

array binseq_to_array( string $seq, $bararray)

Convert binary barcode sequence to TCPDF barcode array



Tags:

return:  barcode representation.
access:  protected


Parameters:

string   $seq   barcode as binary sequence ̣param array $bararray TCPDF barcode array to fill up
   $bararray  

[ Top ]

method checksum_code39 [line 376]

char checksum_code39( string $code)

Calculate CODE 39 checksum (modulo 43).



Tags:

return:  checksum.
access:  protected


Parameters:

string   $code   code to represent.

[ Top ]

method checksum_code93 [line 528]

string checksum_code93( string $code)

Calculate CODE 93 checksum (modulo 47).



Tags:

return:  checksum code.
access:  protected


Parameters:

string   $code   code to represent.

[ Top ]

method checksum_s25 [line 573]

int checksum_s25( string $code)

Checksum for standard 2 of 5 barcodes.



Tags:

return:  checksum.
access:  protected


Parameters:

string   $code   code to process.

[ Top ]

method encode_code39_ext [line 325]

encoded encode_code39_ext( string $code)

Encode a string to be used for CODE 39 Extended mode.



Tags:

return:  string.
access:  protected


Parameters:

string   $code   code to represent.

[ Top ]

method getBarcodeArray [line 92]

array getBarcodeArray( )

Return an array representations of barcode.



Tags:

access:  public


[ Top ]

method setBarcode [line 102]

array setBarcode( string $code, string $type)

Set the barcode.



Tags:

access:  public


Parameters:

string   $code   code to print
string   $type   type of barcode:
  • C39 : CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.
  • C39+ : CODE 39 with checksum
  • C39E : CODE 39 EXTENDED
  • C39E+ : CODE 39 EXTENDED + CHECKSUM
  • C93 : CODE 93 - USS-93
  • S25 : Standard 2 of 5
  • S25+ : Standard 2 of 5 + CHECKSUM
  • I25 : Interleaved 2 of 5
  • I25+ : Interleaved 2 of 5 + CHECKSUM
  • C128A : CODE 128 A
  • C128B : CODE 128 B
  • C128C : CODE 128 C
  • EAN2 : 2-Digits UPC-Based Extention
  • EAN5 : 5-Digits UPC-Based Extention
  • EAN8 : EAN 8
  • EAN13 : EAN 13
  • UPCA : UPC-A
  • UPCE : UPC-E
  • MSI : MSI (Variation of Plessey code)
  • MSI+ : MSI + CHECKSUM (modulo 11)
  • POSTNET : POSTNET
  • PLANET : PLANET
  • RMS4CC : RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)
  • KIX : KIX (Klant index - Customer index)
  • CODABAR : CODABAR
  • CODE11 : CODE 11
  • PHARMA : PHARMACODE
  • PHARMA2T : PHARMACODE TWO-TRACKS

[ Top ]


Documentation generated on Sat, 11 Apr 2009 19:02:27 +0200 by phpDocumentor 1.4.1