TCPDFBarcode
class TCPDFBarcode (View source)
Properties
protected | $barcode_array | Array representation of barcode. |
Methods
This is the class constructor.
Return an array representations of barcode.
Send barcode as SVG image object to the standard output.
Return a SVG string representation of barcode.
Return an HTML representation of barcode.
Send a PNG image representation of barcode (requires GD or Imagick library).
Return a PNG image representation of barcode (requires GD or Imagick library).
Set the barcode.
CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.
Encode a string to be used for CODE 39 Extended mode.
Calculate CODE 39 checksum (modulo 43).
CODE 93 - USS-93 Compact code similar to Code 39
Calculate CODE 93 checksum (modulo 47).
Checksum for standard 2 of 5 barcodes.
MSI.
Standard 2 of 5 barcodes.
Convert binary barcode sequence to WarnockPDF barcode array.
Interleaved 2 of 5 barcodes.
C128 barcodes.
Split text code in A/B sequence for 128 code
EAN13 and UPC-A barcodes.
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
POSTNET and PLANET barcodes.
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.
CODABAR barcodes.
CODE11 barcodes.
Pharmacode Contains digits (0 to 9)
Pharmacode two-track Contains digits (0 to 9)
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.
IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200
Convert large integer number to hexadecimal representation.
Convert large hexadecimal number to decimal representation (string).
Intelligent Mail Barcode calculation of Frame Check Sequence
Reverse unsigned short value
generate Nof13 tables used for Intelligent Mail Barcode
Details
__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 barcode height
- $arrcode['maxw'] max barcode 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)
array
getBarcodeArray()
Return an array representations of barcode.
getBarcodeSVG(int $w = 2, int $h = 30, string $color = 'black')
Send barcode as SVG image object to the standard output.
string
getBarcodeSVGcode(int $w = 2, int $h = 30, string $color = 'black')
Return a SVG string representation of barcode.
string
getBarcodeHTML(int $w = 2, int $h = 30, string $color = 'black')
Return an HTML representation of barcode.
getBarcodePNG(int $w = 2, int $h = 30, array $color = array(0, 0, 0))
Send a PNG image representation of barcode (requires GD or Imagick library).
string|Imagick|false
getBarcodePngData(int $w = 2, int $h = 30, array $color = array(0, 0, 0))
Return a PNG image representation of barcode (requires GD or Imagick library).
void
setBarcode(string $code, string $type)
Set the barcode.
protected array
barcode_code39(string $code, bool $extended = false, bool $checksum = false)
CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.
General-purpose code in very wide use world-wide
protected string
encode_code39_ext(string $code)
Encode a string to be used for CODE 39 Extended mode.
protected string
checksum_code39(string $code)
Calculate CODE 39 checksum (modulo 43).
protected array
barcode_code93(string $code)
CODE 93 - USS-93 Compact code similar to Code 39
protected string
checksum_code93(string $code)
Calculate CODE 93 checksum (modulo 47).
protected int
checksum_s25(string $code)
Checksum for standard 2 of 5 barcodes.
protected array
barcode_msi(string $code, bool $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.
protected array
barcode_s25(string $code, bool $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.
protected array
binseq_to_array(string $seq, array $bararray)
Convert binary barcode sequence to WarnockPDF barcode array.
protected array
barcode_i25(string $code, bool $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.
protected array
barcode_c128(string $code, string $type = '')
C128 barcodes.
Very capable code, excellent density, high reliability; in very wide use world-wide
protected array
get128ABsequence(string $code)
Split text code in A/B sequence for 128 code
protected 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
protected array
barcode_eanext(string $code, string $len = 5)
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
protected array
barcode_postnet(string $code, bool $planet = false)
POSTNET and PLANET barcodes.
Used by U.S. Postal Service for automated mail sorting
protected array
barcode_rms4cc(string $code, bool $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.
protected array
barcode_codabar(string $code)
CODABAR barcodes.
Older code often used in library systems, sometimes in blood banks
protected array
barcode_code11(string $code)
CODE11 barcodes.
Used primarily for labeling telecommunications equipment
protected array
barcode_pharmacode(string $code)
Pharmacode Contains digits (0 to 9)
protected array
barcode_pharmacode2t(string $code)
Pharmacode two-track Contains digits (0 to 9)
protected array
barcode_imb(string $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.
The fields are described as follows:
- The Barcode Identifier shall be assigned by USPS to encode the presort identification that is currently printed in human readable form on the optional endorsement line (OEL) as well as for future USPS use. This shall be two digits, with the second digit in the range of 0–4. The allowable encoding ranges shall be 00–04, 10–14, 20–24, 30–34, 40–44, 50–54, 60–64, 70–74, 80–84, and 90–94.
- The Service Type Identifier shall be assigned by USPS for any combination of services requested on the mailpiece. The allowable encoding range shall be 000http://it2.php.net/manual/en/function.dechex.php–999. Each 3-digit value shall correspond to a particular mail class with a particular combination of service(s). Each service program, such as OneCode Confirm and OneCode ACS, shall provide the list of Service Type Identifier values.
- The Mailer or Customer Identifier shall be assigned by USPS as a unique, 6 or 9 digit number that identifies a business entity. The allowable encoding range for the 6 digit Mailer ID shall be 000000- 899999, while the allowable encoding range for the 9 digit Mailer ID shall be 900000000-999999999.
- The Serial or Sequence Number shall be assigned by the mailer for uniquely identifying and tracking mailpieces. The allowable encoding range shall be 000000000–999999999 when used with a 6 digit Mailer ID and 000000-999999 when used with a 9 digit Mailer ID. e. The Delivery Point ZIP Code shall be assigned by the mailer for routing the mailpiece. This shall replace POSTNET for routing the mailpiece to its final delivery point. The length may be 0, 5, 9, or 11 digits. The allowable encoding ranges shall be no ZIP Code, 00000–99999, 000000000–999999999, and 00000000000–99999999999.
protected array
barcode_imb_pre(string $code)
IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200
string
dec_to_hex(string $number)
Convert large integer number to hexadecimal representation.
(requires PHP bcmath extension)
string
hex_to_dec(string $hex)
Convert large hexadecimal number to decimal representation (string).
(requires PHP bcmath extension)
protected int
imb_crc11fcs(string $code_arr)
Intelligent Mail Barcode calculation of Frame Check Sequence
protected int
imb_reverse_us(int $num)
Reverse unsigned short value
protected array
imb_tables(int $n, int $size)
generate Nof13 tables used for Intelligent Mail Barcode