PEEL Shopping
Open source ecommerce : PEEL Shopping
Public Member Functions | Protected Member Functions | Protected Attributes
PDF417 Class Reference

Class to create PDF417 barcode arrays for TCPDF class. More...

Public Member Functions

 __construct ($code, $ecl=-1, $aspectratio=2, $macro=array())
 This is the class constructor. More...
 
 getBarcodeArray ()
 Returns a barcode array which is readable by TCPDF. More...
 

Protected Member Functions

 getErrorCorrectionLevel ($ecl, $numcw)
 Returns the error correction level (0-8) to be used. More...
 
 getErrorCorrection ($cw, $ecl)
 Returns the error correction codewords. More...
 
 getInputSequences ($code)
 Create array of sequences from input. More...
 
 getCompaction ($mode, $code, $addmode=true)
 Compact data by mode. More...
 

Protected Attributes

 $barcode_array = array()
 Barcode array to be returned which is readable by TCPDF. More...
 
 $start_pattern = '11111111010101000'
 Start pattern. More...
 
 $stop_pattern = '111111101000101001'
 Stop pattern. More...
 
 $textsubmodes
 Array of text Compaction Sub-Modes (values 0xFB - 0xFF are used for submode changers). More...
 
 $textlatch
 Array of switching codes for Text Compaction Sub-Modes. More...
 
 $clusters
 Clusters of codewords (0, 3, 6)
Values are hex equivalents of binary representation of bars (1 = bar, 0 = space). More...
 
 $rsfactors
 Array of factors of the Reed-Solomon polynomial equations used for error correction; one sub array for each correction level (0-8). More...
 

Detailed Description

Class to create PDF417 barcode arrays for TCPDF class.

PDF417 (ISO/IEC 15438:2006) is a 2-dimensional stacked bar code created by Symbol Technologies in 1991.

Definition at line 93 of file pdf417.php.

Constructor & Destructor Documentation

__construct (   $code,
  $ecl = -1,
  $aspectratio = 2,
  $macro = array() 
)

This is the class constructor.

Creates a PDF417 object

Parameters
$code(string) code to represent using PDF417
$ecl(int) error correction level (0-8); default -1 = automatic correction level
$aspectratio(float) the width to height of the symbol (excluding quiet zones)
$macro(array) information for macro block

Definition at line 532 of file pdf417.php.

Member Function Documentation

getBarcodeArray ( )

Returns a barcode array which is readable by TCPDF.

Returns
array barcode array readable by TCPDF;

Definition at line 731 of file pdf417.php.

getCompaction (   $mode,
  $code,
  $addmode = true 
)
protected

Compact data by mode.

Parameters
$mode(int) compaction mode number
$code(string) data to compact
$addmode(boolean) if true add the mode codeword at first position
Returns
array of codewords

Definition at line 873 of file pdf417.php.

getErrorCorrection (   $cw,
  $ecl 
)
protected

Returns the error correction codewords.

Parameters
$cw(array) array of codewords including Symbol Lenght Descriptor and pad
$ecl(int) error correction level 0-8
Returns
array of error correction codewords

Definition at line 780 of file pdf417.php.

getErrorCorrectionLevel (   $ecl,
  $numcw 
)
protected

Returns the error correction level (0-8) to be used.

Parameters
$ecl(int) error correction level
$numcw(int) number of data codewords
Returns
int error correction level

Definition at line 742 of file pdf417.php.

getInputSequences (   $code)
protected

Create array of sequences from input.

Parameters
$code(string) code
Returns
bidimensional array containing characters and classification

Definition at line 816 of file pdf417.php.

Field Documentation

$barcode_array = array()
protected

Barcode array to be returned which is readable by TCPDF.

Definition at line 99 of file pdf417.php.

$clusters
protected

Clusters of codewords (0, 3, 6)
Values are hex equivalents of binary representation of bars (1 = bar, 0 = space).


The codewords numbered from 900 to 928 have special meaning, some enable to switch between modes in order to optimise the code:

  • 900 : Switch to "Text" mode
  • 901 : Switch to "Byte" mode
  • 902 : Switch to "Numeric" mode
  • 903 - 912 : Reserved
  • 913 : Switch to "Octet" only for the next codeword
  • 914 - 920 : Reserved
  • 921 : Initialization
  • 922 : Terminator codeword for Macro PDF control block
  • 923 : Sequence tag to identify the beginning of optional fields in the Macro PDF control block
  • 924 : Switch to "Byte" mode (If the total number of byte is multiple of 6)
  • 925 : Identifier for a user defined Extended Channel Interpretation (ECI)
  • 926 : Identifier for a general purpose ECI format
  • 927 : Identifier for an ECI of a character set or code page
  • 928 : Macro marker codeword to indicate the beginning of a Macro PDF Control Block

Definition at line 156 of file pdf417.php.

$rsfactors
protected

Array of factors of the Reed-Solomon polynomial equations used for error correction; one sub array for each correction level (0-8).

Definition at line 445 of file pdf417.php.

$start_pattern = '11111111010101000'
protected

Start pattern.

Definition at line 105 of file pdf417.php.

$stop_pattern = '111111101000101001'
protected

Stop pattern.

Definition at line 111 of file pdf417.php.

$textlatch
protected
Initial value:
= array(
'01' => array(27), '02' => array(28), '03' => array(28,25),
'10' => array(28,28), '12' => array(28), '13' => array(28,25),
'20' => array(28), '21' => array(27), '23' => array(25),
'30' => array(29), '31' => array(29,27), '32' => array(29,28)
)

Array of switching codes for Text Compaction Sub-Modes.

Definition at line 128 of file pdf417.php.

$textsubmodes
protected
Initial value:
= array(
array(0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x20,0xFD,0xFE,0xFF),
array(0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x20,0xFD,0xFE,0xFF),
array(0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x26,0x0d,0x09,0x2c,0x3a,0x23,0x2d,0x2e,0x24,0x2f,0x2b,0x25,0x2a,0x3d,0x5e,0xFB,0x20,0xFD,0xFE,0xFF),
array(0x3b,0x3c,0x3e,0x40,0x5b,0x5c,0x5d,0x5f,0x60,0x7e,0x21,0x0d,0x09,0x2c,0x3a,0x0a,0x2d,0x2e,0x24,0x2f,0x22,0x7c,0x2a,0x28,0x29,0x3f,0x7b,0x7d,0x27,0xFF)
)

Array of text Compaction Sub-Modes (values 0xFB - 0xFF are used for submode changers).

Definition at line 117 of file pdf417.php.


The documentation for this class was generated from the following file:

This documentation for Open ecommerce PEEL Shopping and PEEL.fr has been generated by Doxygen on Thu Oct 15 2015 14:41:43 - Peel ecommerce is a product of Agence web Advisto SAS. All rights reserved.