com-tecnick-tcpdf

# Procedural File: qrcode.php

Source Location: /qrcode.php

## Classes:

QRcode
  Class to create QR-code arrays for TCPDF class.

## Page Details:

Class to create QR-code arrays for TCPDF class.

QR Code symbol is a 2D barcode that can be scanned by handy terminals such as a mobile phone with CCD. The capacity of QR Code is up to 7000 digits or 4000 characters, and has high robustness. This class supports QR Code model 2, described in JIS (Japanese Industrial Standards) X0510:2004 or ISO/IEC 18004. Currently the following features are not supported: ECI and FNC1 mode, Micro QR Code, QR Code model 1, Structured mode.

This class is derived from "PHP QR Code encoder" by Dominik Dzienia (http://phpqrcode.sourceforge.net/) based on "libqrencode C library 3.1.1." by Kentaro Fukuchi (http://megaui.net/fukuchi/works/qrencode/index.en.html), contains Reed-Solomon code written by Phil Karn, KA9Q. QR Code is registered trademark of DENSO WAVE INCORPORATED (http://www.denso-wave.com/qrcode/index-e.html). Please read comments on this class source file for full copyright and license information.

#### Tags:

author: | Nicola Asuni
version: | 1.0.008
copyright: | 2010-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
link: | http://www.tcpdf.org
abstract: | Class for generating QR-code array for TCPDF.
license: | LGPL

### MAX_STRUCTURED_SYMBOLS [line 204]

`MAX_STRUCTURED_SYMBOLS = 16`

Max number of symbols for structured mode
[ Top ]

### N1 [line 213]

`N1 = 3`

Down point base value for case 1 mask pattern (concatenation of same color in a line or a column)
[ Top ]

### N2 [line 218]

`N2 = 3`

Down point base value for case 2 mask pattern (module block of same color)
[ Top ]

### N3 [line 223]

`N3 = 40`

Down point base value for case 3 mask pattern (1:1:3:1:1(dark:bright:dark:bright:dark)pattern in a line or a column)
[ Top ]

### N4 [line 228]

`N4 = 10`

Down point base value for case 4 mask pattern (ration of dark modules in whole)
[ Top ]

### QRCAP_EC [line 190]

`QRCAP_EC = 3`

Matrix index to get error correction level from $capacity array.
[ Top ]

### QRCAP_REMINDER [line 185]

`QRCAP_REMINDER = 2`

Matrix index to get remainder from $capacity array.
[ Top ]

### QRCAP_WIDTH [line 175]

`QRCAP_WIDTH = 0`

Matrix index to get width from $capacity array.
[ Top ]

### QRCAP_WORDS [line 180]

`QRCAP_WORDS = 1`

Matrix index to get number of words from $capacity array.
[ Top ]

### QRCODEDEFS [line 91]

`QRCODEDEFS = true`

Indicate that definitions for this class are set
[ Top ]

### QRSPEC_VERSION_MAX [line 163]

`QRSPEC_VERSION_MAX = 40`

Maximum QR Code version.
[ Top ]

### QRSPEC_WIDTH_MAX [line 168]

`QRSPEC_WIDTH_MAX = 177`

Maximum matrix size for maximum version (version 40 is 177*177 matrix).
[ Top ]

### QR_DEFAULT_MASK [line 247]

`QR_DEFAULT_MASK = 2`

when QR_FIND_BEST_MASK === false
[ Top ]

### QR_ECLEVEL_H [line 151]

`QR_ECLEVEL_H = 3`

Error correction level H : About 30% or less errors can be corrected.
[ Top ]

### QR_ECLEVEL_L [line 136]

`QR_ECLEVEL_L = 0`

Error correction level L : About 7% or less errors can be corrected.
[ Top ]

### QR_ECLEVEL_M [line 141]

`QR_ECLEVEL_M = 1`

Error correction level M : About 15% or less errors can be corrected.
[ Top ]

### QR_ECLEVEL_Q [line 146]

`QR_ECLEVEL_Q = 2`

Error correction level Q : About 25% or less errors can be corrected.
[ Top ]

### QR_FIND_BEST_MASK [line 237]

`QR_FIND_BEST_MASK = true`

if true, estimates best mask (spec. default, but extremally slow; set to false to significant performance boost but (propably) worst quality code
[ Top ]

### QR_FIND_FROM_RANDOM [line 242]

`QR_FIND_FROM_RANDOM = 2`

if false, checks all masks available, otherwise value tells count of masks need to be checked, mask id are got randomly
[ Top ]

### QR_MODE_8B [line 115]

`QR_MODE_8B = 2`

Encoding mode 8bit byte data. In theory, 2953 characters or less can be stored in a QRcode.
[ Top ]

### QR_MODE_AN [line 110]

`QR_MODE_AN = 1`

Encoding mode alphanumeric (0-9A-Z $%*+-./:) 45characters. 2 characters are encoded to 11bit length. In theory, 4296 characters or less can be stored in a QRcode.
[ Top ]

### QR_MODE_KJ [line 120]

`QR_MODE_KJ = 3`

Encoding mode KANJI. A KANJI character (multibyte character) is encoded to 13bit length. In theory, 1817 characters or less can be stored in a QRcode.
[ Top ]

### QR_MODE_NL [line 100]

`QR_MODE_NL = -1`

Encoding mode
[ Top ]

### QR_MODE_NM [line 105]

`QR_MODE_NM = 0`

Encoding mode numeric (0-9). 3 characters are encoded to 10bit length. In theory, 7089 characters or less can be stored in a QRcode.
[ Top ]

### QR_MODE_ST [line 125]

`QR_MODE_ST = 4`

Encoding mode STRUCTURED (currently unsupported)
[ Top ]

### STRUCTURE_HEADER_BITS [line 199]

`STRUCTURE_HEADER_BITS = 20`

Number of header bits for structured mode
[ Top ]

### str_split [line 265]

`If str_split( string $string, [int $split_length = 1])`

Convert a string to an array (needed for PHP4 compatibility)

#### Tags:

return: | the optional split_length parameter is specified, the returned array will be broken down into chunks with each being split_length in length, otherwise each chunk will be one character in length. FALSE is returned if split_length is less than 1. If the split_length length exceeds the length of string , the entire string is returned as the first (and only) array element.

#### Parameters

string | $string | The input string.
int | $split_length | Maximum length of the chunk.

[ Top ]

Documentation generated on Sat, 04 Dec 2010 11:25:36 +0100 by phpDocumentor 1.4.3