Data

Data for Datamatrix Barcode type class

Namespace: Com\Tecnick\Barcode\Type\Square\Datamatrix

class Data

Source: src/Type/Square/Datamatrix/Data.php:36

Data for Datamatrix Barcode type class

Constants

CHSET

Basic set of characters for each encodation mode.

public const CHSET = ['C40' => [
    // Basic set for C40
    'S1' => 0x0,
    'S2' => 0x1,
    'S3' => 0x2,
    0x20 => 0x3,
    0x30 => 0x4,
    0x31 => 0x5,
    0x32 => 0x6,
    0x33 => 0x7,
    0x34 => 0x8,
    0x35 => 0x9,
// … truncated, see source

Source: src/Type/Square/Datamatrix/Data.php:1098

CHSET_ID

Map encodation modes with character sets.

public const CHSET_ID = [self::ENC_C40 => 'C40', self::ENC_TXT => 'TXT', self::ENC_X12 => 'X12']

Source: src/Type/Square/Datamatrix/Data.php:1087

ENC_ASCII

ASCII encoding: ASCII character 0 to 127 (1 byte per CW)

public const ENC_ASCII = 0

Source: src/Type/Square/Datamatrix/Data.php:52

ENC_ASCII_EXT

ASCII extended encoding: ASCII character 128 to 255 (1/2 byte per CW)

public const ENC_ASCII_EXT = 6

Source: src/Type/Square/Datamatrix/Data.php:94

ENC_ASCII_NUM

ASCII number encoding: ASCII digits (2 bytes per CW)

public const ENC_ASCII_NUM = 7

Source: src/Type/Square/Datamatrix/Data.php:101

ENC_BASE256

BASE 256 encoding: ASCII character 0 to 255 (1 byte per CW)

public const ENC_BASE256 = 5

Source: src/Type/Square/Datamatrix/Data.php:87

ENC_C40

C40 encoding: Upper-case alphanumeric (3/2 bytes per CW)

public const ENC_C40 = 1

Source: src/Type/Square/Datamatrix/Data.php:59

ENC_EDF

EDIFACT encoding: ASCII character 32 to 94 (4/3 bytes per CW)

public const ENC_EDF = 4

Source: src/Type/Square/Datamatrix/Data.php:80

ENC_TXT

TEXT encoding: Lower-case alphanumeric (3/2 bytes per CW)

public const ENC_TXT = 2

Source: src/Type/Square/Datamatrix/Data.php:66

ENC_X12

X12 encoding: ANSI X12 (3/2 byte per CW)

public const ENC_X12 = 3

Source: src/Type/Square/Datamatrix/Data.php:73

ENCOPTS

Encoding options that can be specified as input parameter.

public const ENCOPTS = ['ASCII' => \Com\Tecnick\Barcode\Type\Square\Datamatrix\Data::ENC_ASCII, 'C40' => \Com\Tecnick\Barcode\Type\Square\Datamatrix\Data::ENC_C40, 'TXT' => \Com\Tecnick\Barcode\Type\Square\Datamatrix\Data::ENC_TXT, 'X12' => \Com\Tecnick\Barcode\Type\Square\Datamatrix\Data::ENC_X12, 'EDF' => \Com\Tecnick\Barcode\Type\Square\Datamatrix\Data::ENC_EDF, 'BASE256' => \Com\Tecnick\Barcode\Type\Square\Datamatri
// … truncated, see source

Source: src/Type/Square/Datamatrix/Data.php:108

SWITCHCDW

Switch codewords.

public const SWITCHCDW = [\Com\Tecnick\Barcode\Type\Square\Datamatrix\Data::ENC_ASCII => 254, \Com\Tecnick\Barcode\Type\Square\Datamatrix\Data::ENC_C40 => 230, \Com\Tecnick\Barcode\Type\Square\Datamatrix\Data::ENC_TXT => 239, \Com\Tecnick\Barcode\Type\Square\Datamatrix\Data::ENC_X12 => 238, \Com\Tecnick\Barcode\Type\Square\Datamatrix\Data::ENC_EDF => 240, \Com\Tecnick\Barcode\Type\Square\Datamatrix\Data::ENC_BASE256 => 23
// … truncated, see source

Source: src/Type/Square/Datamatrix/Data.php:122

SYMBATTR

Table of Data Matrix ECC 200 Symbol Attributes.

The shape key S holds the square sizes and R the rectangular sizes of ISO/IEC 16022; the key E holds the Data Matrix Rectangular Extension sizes of ISO/IEC 21471. <ul><li>SHAPE<ul> <li>total matrix rows (including finder pattern)</li> <li>total matrix cols (including finder pattern)</li> <li>total matrix rows (without finder pattern)</li> <li>total matrix cols (without finder pattern)</li> <li>region data rows (with finder pattern)</li> <li>region data col (with finder pattern)</li> <li>region data rows (without finder pattern)</li> <li>region data col (without finder pattern)</li> <li>horizontal regions</li> <li>vertical regions</li> <li>regions</li> <li>data codewords</li> <li>error codewords</li> <li>blocks</li> <li>data codewords per block</li> <li>error codewords per block</li> </ul></li></ul>

public const SYMBATTR = ['S' => [
    // square form
    // 10x10
    [0xa, 0xa, 0x8, 0x8, 0xa, 0xa, 0x8, 0x8, 0x1, 0x1, 0x1, 0x3, 0x5, 0x1, 0x3, 0x5],
    // 12x12
    [0xc, 0xc, 0xa, 0xa, 0xc, 0xc, 0xa, 0xa, 0x1, 0x1, 0x1, 0x5, 0x7, 0x1, 0x5, 0x7],
    // 14x14
    [0xe, 0xe, 0xc, 0xc, 0xe, 0xe, 0xc, 0xc, 0x1, 0x1, 0x1, 0x8, 0xa, 0x1, 0x8, 0xa],
    // 16x16
// … truncated, see source

Source: src/Type/Square/Datamatrix/Data.php:157

Methods

getPaddingSize()

Get the required codewords padding size

public static getPaddingSize(string $shape, int $ncw, string $size = ''): array{int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int}

Parameters:

  • $shape (string): Shape.
  • $ncw (int): Number of codewords.
  • $size (string): Symbol size as rows by columns, empty for the smallest one that fits.

Returns: array{int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int}

Throws:

Source: src/Type/Square/Datamatrix/Data.php:1378