PHP Class Milon\Barcode\PDF417

Author: Dinesh Rabara
Show file Open project: milon/barcode Class Usage Examples

Protected Properties

Property Type Description
$barcode_array Barcode array to be returned which is readable by Dinesh Rabara.
$clusters 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
$rsfactors Array of factors of the Reed-Solomon polynomial equations used for error correction; one sub array for each correction level (0-8).
$start_pattern Start pattern.
$stop_pattern Stop pattern.
$textlatch Array of switching codes for Text Compaction Sub-Modes.
$textsubmodes Array of text Compaction Sub-Modes (values 0xFB - 0xFF are used for submode changers).

Public Methods

Method Description
__construct ( $code, $ecl, $aspectratio = 2, $macro = [] ) This is the class constructor.
getBarcodeArray ( ) : array Returns a barcode array which is readable by Dinesh Rabara

Protected Methods

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

Method Details

__construct() public method

Creates a PDF417 object
public __construct ( $code, $ecl, $aspectratio = 2, $macro = [] )
$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

getBarcodeArray() public method

Returns a barcode array which is readable by Dinesh Rabara
public getBarcodeArray ( ) : array
return array barcode array readable by Dinesh Rabara;

getCompaction() protected method

Compact data by mode.
protected getCompaction ( $mode, $code, $addmode = true ) : array
$mode (int) compaction mode number
$code (string) data to compact
$addmode (boolean) if true add the mode codeword at first position
return array of codewords

getErrorCorrection() protected method

Returns the error correction codewords
protected getErrorCorrection ( $cw, $ecl ) : array
$cw (array) array of codewords including Symbol Lenght Descriptor and pad
$ecl (int) error correction level 0-8
return array of error correction codewords

getErrorCorrectionLevel() protected method

Returns the error correction level (0-8) to be used
protected getErrorCorrectionLevel ( $ecl, $numcw ) : integer
$ecl (int) error correction level
$numcw (int) number of data codewords
return integer error correction level

getInputSequences() protected method

Create array of sequences from input
protected getInputSequences ( $code ) : bidimensional
$code (string) code
return bidimensional array containing characters and classification

Property Details

$barcode_array protected property

Barcode array to be returned which is readable by Dinesh Rabara.
protected $barcode_array

$clusters protected property

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
protected $clusters

$rsfactors protected property

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

$start_pattern protected property

Start pattern.
protected $start_pattern

$stop_pattern protected property

Stop pattern.
protected $stop_pattern

$textlatch protected property

Array of switching codes for Text Compaction Sub-Modes.
protected $textlatch

$textsubmodes protected property

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