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
-
quietZone={
quietZone } — Specifies to draw a quiet zone around the barcode -
mode={
mode } — Specifies the mode -
acceptECI={
accept } — Specifies to accepts the ECI codes
BakeryBarcode2D's Methods
-
scaleX={
scaleX } — Sets the scaling X for the barcode -
scaleY={
scaleY } — Sets the scaling Y for the barcode
BakeryBarcode's Methods
-
text={
text } — Analyzes atext message to draw afterwards -
scale={
scale } — Sets the scale of the barcode -
foregroundColor={
color } — Sets the color of the bars -
backgroundColor={
color } — Sets the color of the spaces -
offsetX={
value } — Sets the X offset -
offsetY={
value } — Sets the Y offset
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 barcodeDescriptionTo 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 modeDescriptionSpecifies 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 codesDescriptionBy settingtrue 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 barcodeDescriptionThe 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 barcodeDescriptionThe height in pixel of one module.
The default value is 1.
Note that this method is protected.
-
text={
text } — Analyzes atext message to draw afterwardsDescriptionThe data you pass to thetext 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 barcodeDescriptionThe barcode will bex times bigger. Then a pixel will bex byx for its size. -
foregroundColor={
color } — Sets the color of the barsDescriptionSets the color of the bars of the barcode. By default, the color is black. This argument can be aBakeryColor class or any other argument thatBakeryColor can accept in its constructor. -
backgroundColor={
color } — Sets the color of the spacesDescriptionSets the color of the spaces of the barcode. By default, the color is white. This argument can be aBakeryColor class or any other argument thatBakeryColor can accept in its constructor. -
offsetX={
value } — Sets the X offsetDescriptionSpecifies the X offset of the barcode in pixels multiplied by the scale. -
offsetY={
value } — Sets the Y offsetDescriptionSpecifies the Y offset of the barcode in pixels multiplied by the scale.