Manual - MaxiCode

Introduction

MaxiCode comes from the 2D barcode family. You can encode a specific amount of information within a single barcode.
All the ASCII characters from 0 to 255 are supported. MaxiCode encodes data differently based on the type of characters provided. Some characters are encoded with a higher compression level. See the compression level on the technical page.

This class inherits the BakeryBarcode2D class.

Example

Methods

BakeryMaxicode's Methods

BakeryBarcode2D's Methods

BakeryBarcode's Methods

Code Example

import { BakeryColor, BakeryFont } from '@barcode-bakery/barcode-react';
import { BakeryMaxicode } from '@barcode-bakery/barcode-react/maxicode';

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

  return <BakeryMaxicode
    scale={2}
    foregroundColor={colorBlack}
    backgroundColor={colorWhite}
    text='Maxicode'
  >;
}

Method explanations

  • quietZone={quietZone} — Specifies to draw a quiet zone around the barcode
    Description
    To be read correctly, the MaxiCode must have a quiet zone around the image. You can, however, turn this off.
    The default value is true.
  • mode={mode} — Specifies the mode
    Description
    Specifies the mode to generate the barcode. You can use a mode from 2 to 6. See the technical information page for more information.
    The default value is 4.
  • acceptECI={accept} — Specifies to accepts the ECI codes
    Description
    By setting true in this argument, the backslash characters (ASCII 92 \) will be processed as special characters. These are the special characters you can write.
    - \\ : Writes a simple backslash
    - \xxxxxx : Writes the ECI xxxxxx character with x representing an integer from 0 to 9
    The default value is false.
  • 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.