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
-
errorLevel={
level } — Sets the error correction level of the barcode -
size={
value } — Sets the size of the barcode -
tilde={
accept } — Modifies the use of the tilde character ~ -
rune={
runeNumber } — Specifies to draw a Rune
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 { 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 barcodeDescriptionThe 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 barcodeDescriptionThe 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 isBakeryAztec.Size.Smallest . -
tilde={
accept } — Modifies the use of the tilde character ~DescriptionBy settingtrue 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 RuneDescriptionThe Rune numberruneNumber 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 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.