Select your printer model

Parameters are refined by the selected printer.

addSymbol method


Adds a 2D symbol print command to the command buffer.

Syntax

 
addSymbol(data, type, level, width, height, size);

Parameter

data

String

Description

String

Specifies 2D symbol data as a text string.

Use the following escape sequences to specify binary data which cannot be represented as a string:

String

Description

\xnn

Control code (set nn in hexadecimal)

\\

Back slash

type

Constant

2D symbol type

SYMBOL_PDF417_STANDARD

Standard PDF417

SYMBOL_PDF417_TRUNCATED

Truncated PDF417

SYMBOL_QRCODE_MODEL_1

QR Code Model 1

SYMBOL_QRCODE_MODEL_2

QR Code Model 2

SYMBOL_QRCODE_MICRO

Micro QR Code

SYMBOL_MAXICODE_MODE_2

MaxiCode Mode 2

SYMBOL_MAXICODE_MODE_3

MaxiCode Mode 3

SYMBOL_MAXICODE_MODE_4

MaxiCode Mode 4

SYMBOL_MAXICODE_MODE_5

MaxiCode Mode 5

SYMBOL_MAXICODE_MODE_6

MaxiCode Mode 6

SYMBOL_GS1_DATABAR_STACKED

GS1 DataBar Stacked

SYMBOL_GS1_DATABAR_STACKED_OMNIDIRECTIONAL

GS1 DataBar Stacked Omnidirectional

SYMBOL_GS1_DATABAR_EXPANDED_STACKED

GS1 DataBar Expanded Stacked

SYMBOL_AZTECCODE_FULLRANGE

Aztec Code Full-Range mode

SYMBOL_AZTECCODE_COMPACT

Aztec Code Compact mode

SYMBOL_DATAMATRIX_SQUARE

DataMatrix ECC200 Square

SYMBOL_DATAMATRIX_RECTANGLE_8

DataMatrix ECC200 Rectangle, 8 lines

SYMBOL_DATAMATRIX_RECTANGLE_12

DataMatrix ECC200 Rectangle, 12 lines

SYMBOL_DATAMATRIX_RECTANGLE_16

DataMatrix ECC200 Rectangle, 16 lines

2D symbol type

Description

Standard PDF417

Converts the string into UTF-8, processes the escape sequence(s), and encodes the data.
The maximum number of code words in the data area is 928, the maximum number of code words in a single stage is 30, and the maximum number of stages is 90.

Truncated PDF417

QR Code Model 1

Converts the string into JIS, processes the escape sequence(s), and encodes the data by choosing the data type from the following:

  • Figure: 0 to 9
  • Alphanumeric: 0 to 9, A to Z, space, $, %, *, +, -, ., /, :
  • Kanji character: Shift JIS value
  • 8-bit byte data: 0X00 to 0xff

QR Code Model 2

Micro QR Code2

MaxiCode Mode 2

Converts the string into UTF-8, processes the escape sequence(s), and encodes the data.
In Mode 2 or 3, if the first data is ][)>\x1e01\x1dyy ("yy" is a 2-digit figure), this is processed as the message header and the second and succeeding data sequence is processed as the primary message. Otherwise, the primary message starts with the fist data.
For the mode 2, specify the primary message in the following format:

  • Postal code (1- to 9-digit number) GS: (\x1d)
  • ISO country code (1- to 3-digit number) GS: (\x1d)
  • Service class code (1- to 3-digit number)

For the mode 3, specify the primary message in the following format:

  • Postal code (data which can be converted with 1 to 6 code sets A) GS (\x1d) ISO
  • country code (1- to 3-digit figure) GS (\x1d)
  • Service class code (1- to 3-digit number)

MaxiCode Mode 3

MaxiCode Mode 4

MaxiCode Mode 5

MaxiCode Mode 6

GS1 DataBar Stacked

Converts the string into UTF-8, processes the escape sequence(s), and encodes the data.
Specify a 13-digit product ID (GTIN) excluding the application ID (AI) and check digit.

GS1 DataBar Stacked Omnidirectional

GS1 DataBar Expanded Stacked

Converts the string into UTF-8, processes the escape sequence(s), and encodes the data.
The application ID (AI) can be put in parentheses. The parentheses are used as print characters for HRI and not encoded as data.
To encode the following characters, specify the corresponding 2-digit code starting with { :

  • FNC1: {1
  • (: {(
  • ): {)

Aztec Code

Converts the string into UTF-8, processes the escape sequence(s), and encodes the data.

DataMatrix

Converts the string into UTF-8, processes the escape sequence(s), and encodes the data.

level

  • PDF417

Constant

Description

LEVEL_0

Error correction level 0

LEVEL_1

Error correction level 1

LEVEL_2

Error correction level 2

LEVEL_3

Error correction level 3

LEVEL_4

Error correction level 4

LEVEL_5

Error correction level 5

LEVEL_6

Error correction level 6

LEVEL_7

Error correction level 7

LEVEL_8

Error correction level 8

LEVEL_DEFAULT

Default value (error correction level 1)

  • QR Code

Constant

Description

LEVEL_L

Error correction level L

LEVEL_M

Error correction level M

LEVEL_Q

Error correction level Q

LEVEL_H

Error correction level H

LEVEL_DEFAULT

Default value (error correction level M)

  • Aztec Code

Constant

Description

Integer (5 to 95)

Error correction level

LEVEL_DEFAULT

Default value (error correction level 23)

width

2D symbol type

Valid value

Default value

PDF417

2 to 8

3

QR Code

3 to 16

3

MaxiCode

Not used

2D GS1 DataBar

2 to 8

2

Aztec Code

2 to 16

3

DataMatrix

2 to 16

3

height

2D symbol type

Valid value

Default value

PDF417

2 to 8
(Scaling factor for width)

3

QR Code

Not used

MaxiCode

2D GS1 DataBar

Aztec Code

DataMatrix

size

2D symbol type

Default value

Description

PDF417

0 (auto)

Specifies the number of code words per stage.

QR Code

Ignored

MaxiCode

Ignored

2D GS1 DataBar

Expanded Stacked

0 (auto)

Specifies the maximum width of the 2D symbol (106 or more).

Other

Ignored

Aztec Code

Ignored

DataMatrix

Ignored

Return value

Return value

Object type

Printer object

Printer

HybridPrinter2 object

HybridPrinter2

Exception

Exception

Object type

Parameter " ... " is invalid

Error

Supplementary explanation

  • Use the addSymbol method at the beginning of a line.
  • In the page mode, a 2D symbol is printed at the current print position with the lower-left dot of the 2D symbol as the reference point.
  • Specify a string in accordance with the type of the 2D symbol specified in type. The 2D symbol is not printed if the string specified in data does not match the 2D symbol type specified in type.
  • Micro QR Code does not support LEVEL_H.
  • Specify a constant in accordance with the 2D symbol type specified in type.
  • When MaxiCode or 2D GS1 DataBar is specified in data, specify LEVEL_DEFAULT.
 

Quick Access

  • [Name]
  • [Format]
  • [Range]
  • [Description]
  • [Notes]

Epson ePOS SDK includes patented or patent pending functions. The contents must not be disclosed to third parties.


Epson ePOS SDK for JavaScript

Jump to the top