ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
PHP class to creates array representations for common 1D barcodes to be used with TCPDF (http://www.tcpdf.org). More...
Public Member Functions | |
__construct ($code, $type) | |
This is the class constructor. More... | |
getBarcodeArray () | |
Return an array representations of barcode. More... | |
getBarcodeSVG ($w=2, $h=30, $color='black') | |
Send barcode as SVG image object to the standard output. More... | |
getBarcodeSVGcode ($w=2, $h=30, $color='black') | |
Return a SVG string representation of barcode. More... | |
getBarcodeHTML ($w=2, $h=30, $color='black') | |
Return an HTML representation of barcode. More... | |
getBarcodePNG ($w=2, $h=30, $color=array(0, 0, 0)) | |
Send a PNG image representation of barcode (requires GD or Imagick library). More... | |
getBarcodePngData ($w=2, $h=30, $color=array(0, 0, 0)) | |
Return a PNG image representation of barcode (requires GD or Imagick library). More... | |
setBarcode ($code, $type) | |
Set the barcode. More... | |
dec_to_hex ($number) | |
Convert large integer number to hexadecimal representation. More... | |
hex_to_dec ($hex) | |
Convert large hexadecimal number to decimal representation (string). More... | |
Protected Member Functions | |
barcode_code39 ($code, $extended=false, $checksum=false) | |
CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9. More... | |
encode_code39_ext ($code) | |
Encode a string to be used for CODE 39 Extended mode. More... | |
checksum_code39 ($code) | |
Calculate CODE 39 checksum (modulo 43). More... | |
barcode_code93 ($code) | |
CODE 93 - USS-93 Compact code similar to Code 39. More... | |
checksum_code93 ($code) | |
Calculate CODE 93 checksum (modulo 47). More... | |
checksum_s25 ($code) | |
Checksum for standard 2 of 5 barcodes. More... | |
barcode_msi ($code, $checksum=false) | |
MSI. More... | |
barcode_s25 ($code, $checksum=false) | |
Standard 2 of 5 barcodes. More... | |
binseq_to_array ($seq, $bararray) | |
Convert binary barcode sequence to TCPDF barcode array. More... | |
barcode_i25 ($code, $checksum=false) | |
Interleaved 2 of 5 barcodes. More... | |
barcode_c128 ($code, $type='') | |
C128 barcodes. More... | |
get128ABsequence ($code) | |
Split text code in A/B sequence for 128 code. More... | |
barcode_eanupc ($code, $len=13) | |
EAN13 and UPC-A barcodes. More... | |
barcode_eanext ($code, $len=5) | |
UPC-Based Extensions 2-Digit Ext. More... | |
barcode_postnet ($code, $planet=false) | |
POSTNET and PLANET barcodes. More... | |
barcode_rms4cc ($code, $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. More... | |
barcode_codabar ($code) | |
CODABAR barcodes. More... | |
barcode_code11 ($code) | |
CODE11 barcodes. More... | |
barcode_pharmacode ($code) | |
Pharmacode Contains digits (0 to 9) More... | |
barcode_pharmacode2t ($code) | |
Pharmacode two-track Contains digits (0 to 9) More... | |
barcode_imb ($code) | |
IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200 (requires PHP bcmath extension) Intelligent Mail barcode is a 65-bar code for use on mail in the United States. More... | |
barcode_imb_pre ($code) | |
IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200. More... | |
imb_crc11fcs ($code_arr) | |
Intelligent Mail Barcode calculation of Frame Check Sequence. More... | |
imb_reverse_us ($num) | |
Reverse unsigned short value. More... | |
imb_tables ($n, $size) | |
generate Nof13 tables used for Intelligent Mail Barcode More... | |
Protected Attributes | |
$barcode_array | |
Array representation of barcode. More... | |
PHP class to creates array representations for common 1D barcodes to be used with TCPDF (http://www.tcpdf.org).
Definition at line 50 of file tcpdf_barcodes_1d.php.
TCPDFBarcode::__construct | ( | $code, | |
$type | |||
) |
This is the class constructor.
Return an array representations for common 1D barcodes:
$code | (string) code to print |
$type | (string) type of barcode:
|
Definition at line 73 of file tcpdf_barcodes_1d.php.
References $code, $type, and setBarcode().
|
protected |
C128 barcodes.
Very capable code, excellent density, high reliability; in very wide use world-wide
$code | (string) code to represent. |
$type | (string) barcode type: A, B, C or empty for automatic switch (AUTO mode) |
Definition at line 958 of file tcpdf_barcodes_1d.php.
References $code, $i, $key, $t, $type, $w, array, and get128ABsequence().
Referenced by setBarcode().
|
protected |
CODABAR barcodes.
Older code often used in library systems, sometimes in blood banks
$code | (string) code to represent. |
Definition at line 1819 of file tcpdf_barcodes_1d.php.
References $code, $i, $t, $w, and array.
Referenced by setBarcode().
|
protected |
CODE11 barcodes.
Used primarily for labeling telecommunications equipment
$code | (string) code to represent. |
Definition at line 1875 of file tcpdf_barcodes_1d.php.
References $code, $i, $t, $w, and array.
Referenced by setBarcode().
|
protected |
CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.
General-purpose code in very wide use world-wide
$code | (string) code to represent. |
$extended | (boolean) if true uses the extended mode. |
$checksum | (boolean) if true add a checksum to the code. |
Definition at line 393 of file tcpdf_barcodes_1d.php.
References $code, $i, $t, $w, array, checksum_code39(), and encode_code39_ext().
Referenced by setBarcode().
|
protected |
CODE 93 - USS-93 Compact code similar to Code 39.
$code | (string) code to represent. |
Definition at line 560 of file tcpdf_barcodes_1d.php.
References $code, $i, $t, $w, array, and checksum_code93().
Referenced by setBarcode().
|
protected |
UPC-Based Extensions 2-Digit Ext.
: Used to indicate magazines and newspaper issue numbers 5-Digit Ext.: Used to mark suggested retail price of books
$code | (string) code to represent. |
$len | (string) barcode type: 2 = 2-Digit, 5 = 5-Digit |
Definition at line 1520 of file tcpdf_barcodes_1d.php.
References $code, $i, $r, array, and binseq_to_array().
Referenced by setBarcode().
|
protected |
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
$code | (string) code to represent. |
$len | (string) barcode type: 6 = UPC-E, 8 = EAN8, 13 = EAN13, 12 = UPC-A |
Definition at line 1327 of file tcpdf_barcodes_1d.php.
References $code, $i, $r, $t, $w, and array.
Referenced by setBarcode().
|
protected |
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.
$code | (string) code to represent. |
$checksum | (boolean) if true add a checksum to the code |
Definition at line 894 of file tcpdf_barcodes_1d.php.
References $code, $i, $s, $t, $w, array, and checksum_s25().
Referenced by setBarcode().
|
protected |
IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200 (requires PHP bcmath extension) Intelligent Mail barcode is a 65-bar code for use on mail in the United States.
The fields are described as follows:
$code | (string) code to print, separate the ZIP (routing code) from the rest using a minus char '-' (BarcodeID_ServiceTypeID_MailerID_SerialNumber-RoutingCode) |
Definition at line 2054 of file tcpdf_barcodes_1d.php.
References $code, $data, $h, $i, array, dec_to_hex(), hex_to_dec(), imb_crc11fcs(), and imb_tables().
Referenced by setBarcode().
|
protected |
IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200.
$code | (string) pre-formatted IMB barcode (65 chars "FADT") |
Definition at line 2179 of file tcpdf_barcodes_1d.php.
References $code, $h, $i, and array.
Referenced by setBarcode().
|
protected |
MSI.
Variation of Plessey code, with similar applications Contains digits (0 to 9) and encodes the data only in the width of bars.
$code | (string) code to represent. |
$checksum | (boolean) if true add a checksum to the code (modulo 11) |
Definition at line 763 of file tcpdf_barcodes_1d.php.
References $code, $i, array, and binseq_to_array().
Referenced by setBarcode().
|
protected |
Pharmacode Contains digits (0 to 9)
$code | (string) code to represent. |
Definition at line 1966 of file tcpdf_barcodes_1d.php.
References $code, array, and binseq_to_array().
Referenced by setBarcode().
|
protected |
Pharmacode two-track Contains digits (0 to 9)
$code | (string) code to represent. |
Definition at line 1992 of file tcpdf_barcodes_1d.php.
References $code, $h, $i, and array.
Referenced by setBarcode().
|
protected |
POSTNET and PLANET barcodes.
Used by U.S. Postal Service for automated mail sorting
$code | (string) zip code to represent. Must be a string containing a zip code of the form DDDDD or DDDDD-DDDD. |
$planet | (boolean) if true print the PLANET barcode, otherwise print POSTNET |
Definition at line 1595 of file tcpdf_barcodes_1d.php.
References $code, $h, $i, and array.
Referenced by setBarcode().
|
protected |
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.
$code | (string) code to print |
$kix | (boolean) 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. |
Definition at line 1668 of file tcpdf_barcodes_1d.php.
References $code, $h, $i, $row, and array.
Referenced by setBarcode().
|
protected |
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.
$code | (string) code to represent. |
$checksum | (boolean) if true add a checksum to the code |
Definition at line 822 of file tcpdf_barcodes_1d.php.
References $code, $i, array, binseq_to_array(), and checksum_s25().
Referenced by setBarcode().
|
protected |
Convert binary barcode sequence to TCPDF barcode array.
$seq | (string) barcode as binary sequence. |
$bararray | (array) barcode array. òparam array $bararray TCPDF barcode array to fill up |
Definition at line 864 of file tcpdf_barcodes_1d.php.
References $i, $t, $w, and array.
Referenced by barcode_eanext(), barcode_msi(), barcode_pharmacode(), and barcode_s25().
|
protected |
Calculate CODE 39 checksum (modulo 43).
$code | (string) code to represent. |
Definition at line 537 of file tcpdf_barcodes_1d.php.
References $code, $i, and array.
Referenced by barcode_code39().
|
protected |
Calculate CODE 93 checksum (modulo 47).
$code | (string) code to represent. |
Definition at line 688 of file tcpdf_barcodes_1d.php.
References $code, $i, and array.
Referenced by barcode_code93().
|
protected |
Checksum for standard 2 of 5 barcodes.
$code | (string) code to process. |
Definition at line 737 of file tcpdf_barcodes_1d.php.
Referenced by barcode_i25(), and barcode_s25().
TCPDFBarcode::dec_to_hex | ( | $number | ) |
Convert large integer number to hexadecimal representation.
(requires PHP bcmath extension)
$number | (string) number to convert specified as a string |
Definition at line 2229 of file tcpdf_barcodes_1d.php.
Referenced by barcode_imb().
|
protected |
Encode a string to be used for CODE 39 Extended mode.
$code | (string) code to represent. |
Definition at line 486 of file tcpdf_barcodes_1d.php.
References $code, $i, and array.
Referenced by barcode_code39().
|
protected |
Split text code in A/B sequence for 128 code.
$code | (string) code to split. |
Definition at line 1288 of file tcpdf_barcodes_1d.php.
Referenced by barcode_c128().
TCPDFBarcode::getBarcodeArray | ( | ) |
Return an array representations of barcode.
Definition at line 82 of file tcpdf_barcodes_1d.php.
References $barcode_array.
TCPDFBarcode::getBarcodeHTML | ( | $w = 2 , |
|
$h = 30 , |
|||
$color = 'black' |
|||
) |
Return an HTML representation of barcode.
$w | (int) Width of a single bar element in pixels. |
$h | (int) Height of a single bar element in pixels. |
$color | (string) Foreground color for bar elements (background is transparent). |
Definition at line 147 of file tcpdf_barcodes_1d.php.
TCPDFBarcode::getBarcodePNG | ( | $w = 2 , |
|
$h = 30 , |
|||
$color = array(0,0,0) |
|||
) |
Send a PNG image representation of barcode (requires GD or Imagick library).
$w | (int) Width of a single bar element in pixels. |
$h | (int) Height of a single bar element in pixels. |
$color | (array) RGB (0-255) foreground color for bar elements (background is transparent). |
Definition at line 172 of file tcpdf_barcodes_1d.php.
References $data, $h, $w, getBarcodePngData(), and header.
TCPDFBarcode::getBarcodePngData | ( | $w = 2 , |
|
$h = 30 , |
|||
$color = array(0,0,0) |
|||
) |
Return a PNG image representation of barcode (requires GD or Imagick library).
$w | (int) Width of a single bar element in pixels. |
$h | (int) Height of a single bar element in pixels. |
$color | (array) RGB (0-255) foreground color for bar elements (background is transparent). |
Definition at line 192 of file tcpdf_barcodes_1d.php.
References $h, $w, $x, and $y.
Referenced by getBarcodePNG().
TCPDFBarcode::getBarcodeSVG | ( | $w = 2 , |
|
$h = 30 , |
|||
$color = 'black' |
|||
) |
Send barcode as SVG image object to the standard output.
$w | (int) Minimum width of a single bar in user units. |
$h | (int) Height of barcode in user units. |
$color | (string) Foreground color (in SVG format) for bar elements (background is transparent). |
Definition at line 93 of file tcpdf_barcodes_1d.php.
References $code, $h, $w, getBarcodeSVGcode(), and header.
TCPDFBarcode::getBarcodeSVGcode | ( | $w = 2 , |
|
$h = 30 , |
|||
$color = 'black' |
|||
) |
Return a SVG string representation of barcode.
$w | (int) Minimum width of a single bar in user units. |
$h | (int) Height of barcode in user units. |
$color | (string) Foreground color (in SVG format) for bar elements (background is transparent). |
Definition at line 114 of file tcpdf_barcodes_1d.php.
References $h, $w, $x, $y, and array.
Referenced by getBarcodeSVG().
TCPDFBarcode::hex_to_dec | ( | $hex | ) |
Convert large hexadecimal number to decimal representation (string).
(requires PHP bcmath extension)
$hex | (string) hexadecimal number to convert specified as a string |
Definition at line 2253 of file tcpdf_barcodes_1d.php.
Referenced by barcode_imb().
|
protected |
Intelligent Mail Barcode calculation of Frame Check Sequence.
$code_arr | (string) array of hexadecimal values (13 bytes holding 102 bits right justified). |
Definition at line 2270 of file tcpdf_barcodes_1d.php.
References $data.
Referenced by barcode_imb().
|
protected |
Reverse unsigned short value.
$num | (int) value to reversr |
Definition at line 2306 of file tcpdf_barcodes_1d.php.
References $i.
Referenced by imb_tables().
|
protected |
generate Nof13 tables used for Intelligent Mail Barcode
$n | (int) is the type of table: 2 for 2of13 table, 5 for 5of13table |
$size | (int) size of table (78 for n=2 and 1287 for n=5) |
Definition at line 2323 of file tcpdf_barcodes_1d.php.
References $n, $size, $table, array, and imb_reverse_us().
Referenced by barcode_imb().
TCPDFBarcode::setBarcode | ( | $code, | |
$type | |||
) |
Set the barcode.
$code | (string) code to print |
$type | (string) type of barcode:
|
Definition at line 249 of file tcpdf_barcodes_1d.php.
References $code, $type, barcode_c128(), barcode_codabar(), barcode_code11(), barcode_code39(), barcode_code93(), barcode_eanext(), barcode_eanupc(), barcode_i25(), barcode_imb(), barcode_imb_pre(), barcode_msi(), barcode_pharmacode(), barcode_pharmacode2t(), barcode_postnet(), barcode_rms4cc(), and barcode_s25().
Referenced by __construct().
|
protected |
Array representation of barcode.
Definition at line 56 of file tcpdf_barcodes_1d.php.
Referenced by getBarcodeArray().