vendor/phpqrcode/bindings/tcpdfqrcode.php

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.

Classes

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

Constants

QRCODEDEFS

QRCODEDEFS = true

Indicate that definitions for this class are set

QR_MODE_NL

QR_MODE_NL = -1

Encoding mode

QR_MODE_NM

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.

QR_MODE_AN

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.

QR_MODE_8B

QR_MODE_8B = 2

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

QR_MODE_KJ

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.

QR_MODE_ST

QR_MODE_ST = 4

Encoding mode STRUCTURED (currently unsupported)

QR_ECLEVEL_L

QR_ECLEVEL_L = 0

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

QR_ECLEVEL_M

QR_ECLEVEL_M = 1

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

QR_ECLEVEL_Q

QR_ECLEVEL_Q = 2

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

QR_ECLEVEL_H

QR_ECLEVEL_H = 3

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

QRSPEC_VERSION_MAX

QRSPEC_VERSION_MAX = 40

Maximum QR Code version.

QRSPEC_WIDTH_MAX

QRSPEC_WIDTH_MAX = 177

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

QRCAP_WIDTH

QRCAP_WIDTH = 0

Matrix index to get width from $capacity array.

QRCAP_WORDS

QRCAP_WORDS = 1

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

QRCAP_REMINDER

QRCAP_REMINDER = 2

Matrix index to get remainder from $capacity array.

QRCAP_EC

QRCAP_EC = 3

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

STRUCTURE_HEADER_BITS

STRUCTURE_HEADER_BITS = 20

Number of header bits for structured mode

MAX_STRUCTURED_SYMBOLS

MAX_STRUCTURED_SYMBOLS = 16

Max number of symbols for structured mode

N1

N1 = 3

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

N2

N2 = 3

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

N3

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)

N4

N4 = 10

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

QR_FIND_BEST_MASK

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

QR_FIND_FROM_RANDOM

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

QR_DEFAULT_MASK

QR_DEFAULT_MASK = 2

when QR_FIND_BEST_MASK === false

Functions

str_split()

str_split(string  $string, integer  $split_length = 1) : \If

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

Parameters

string $string

The input string.

integer $split_length

Maximum length of the chunk.

Returns

\If —

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.