Manual - Aztec

Introduction

Aztec code comes from the 2D barcode family. You can encode a large amount of information within a single barcode.
All the ASCII characters from 0 to 255 are supported. The barcode size will be determined by the number of data encoded and the chosen error correction level.
You can pass in ECI mode with the function tilde={}.

This class inherits the BakeryBarcode2D class.

Example

Methods

BakeryAztec's Methods

BakeryBarcode2D's Methods

BakeryBarcode's Methods

Code Example

import { BakeryColor, BakeryFont } from '@barcode-bakery/barcode-react';
import { BakeryAztec } from '@barcode-bakery/barcode-react/aztec';

export default function Home() {
  const colorBlack = new BakeryColor(0, 0, 0);
  const colorWhite = new BakeryColor(255, 255, 255);

  return <BakeryAztec
    scale={2}
    foregroundColor={colorBlack}
    backgroundColor={colorWhite}
    text='Aztec'
  >;
}

Method explanations

  • errorLevel={level} — Sets the error correction level of the barcode
    Description
    The error correction level percentage before drawing the barcode.
    The level must be between 5 and 99.
    The default value is 23.
  • size={value} — Sets the size of the barcode
    Description
    The size of the final barcode will be decided automatically depending on the data you give and the error correction level percentage you have chosen.
    You can, however, specify a different value in order to get a different code. Here are the possible values:
    - BakeryAztec.Size.Smallest : The code will be the smallest possible
    - BakeryAztec.Size.Compact : The code will try to be a compact code if possible
    - BakeryAztec.Size.Full : The code will be in full mode (with the reference grid)
    The default value is BakeryAztec.Size.Smallest.
  • tilde={accept} — Modifies the use of the tilde character ~
    Description
    By setting true in this argument, the tilde characters (ASCII 126 ~) will be processed as special characters. These are the special characters you can write.
    - ~~ : Writes a simple tilde
    - ~F : Writes the FNC1 character
    - ~Exxxxxx : Writes the ECI xxxxxx character with x representing an integer from 0 to 9
    The default value is false.
  • rune={runeNumber} — Specifies to draw a Rune
    Description
    The Rune number runeNumber will be drawn to the screen. Runes are special symbols.
    The Rune number has to be between 0 and 255.
    The default value is -1.
  • scaleX={scaleX} — Sets the scaling X for the barcode
    Description
    The width in pixel of one module.
    The default value is 1.
    Note that this method is protected.
  • scaleY={scaleY} — Sets the scaling Y for the barcode
    Description
    The height in pixel of one module.
    The default value is 1.
    Note that this method is protected.
  • text={text} — Analyzes a text message to draw afterwards
    Description
    The data you pass to the text argument must be supported by the type of barcode you use.
    Check each barcode's introduction section to obtain more information on how to use this method within each symbology.
  • scale={scale} — Sets the scale of the barcode
    Description
    The barcode will be x times bigger. Then a pixel will be x by x for its size.
  • foregroundColor={color} — Sets the color of the bars
    Description
    Sets the color of the bars of the barcode. By default, the color is black. This argument can be a BakeryColor class or any other argument that BakeryColor can accept in its constructor.
  • backgroundColor={color} — Sets the color of the spaces
    Description
    Sets the color of the spaces of the barcode. By default, the color is white. This argument can be a BakeryColor class or any other argument that BakeryColor can accept in its constructor.
  • offsetX={value} — Sets the X offset
    Description
    Specifies the X offset of the barcode in pixels multiplied by the scale.
  • offsetY={value} — Sets the Y offset
    Description
    Specifies the Y offset of the barcode in pixels multiplied by the scale.