Manual - Interleaved 2 of 5
Introduction
Interleaved 2 of 5 code (also called I25) encodes numbers from 0 to 9. It can contain a checksum. You must specify to your reader that you have encoded a checksum, otherwise it will be displayed when the code is read.
The number of data included must be even. If you have a checksum, you must enter an odd number of data.
This class inherits the BakeryBarcode1D class.
Example
Methods
BakeryI25's Methods
-
checksum={
checksum } — Specifies if a checksum must be added -
ratio={
ratio } — Specifies the ratio of wide lines to narrow ones
BakeryBarcode1D's Methods
-
thickness={
thickness } — Specifies the thickness of the barcode -
label={
label } — Sets the label -
font={
font } — Sets the text font for the label -
displayChecksum={
display } — Specifies the checksum to be added to the label
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 { BakeryI25 } from '@barcode-bakery/barcode-react/1d';
export default function Home() {
const font = new BakeryFont('Arial', 18);
const colorBlack = new BakeryColor(0, 0, 0);
const colorWhite = new BakeryColor(255, 255, 255);
return <BakeryI25
scale={2}
thickness={30}
foregroundColor={colorBlack}
backgroundColor={colorWhite}
font={font}
text='1234'
>;
}
Method explanations
-
checksum={
checksum } — Specifies if a checksum must be addedDescriptionSpecifies if a checksum must be added. -
ratio={
ratio } — Specifies the ratio of wide lines to narrow onesDescriptionThe ratio indicates by how many pixels the wide lines will be larger than the narrow ones. The usual values would be 1 or 2.
-
thickness={
thickness } — Specifies the thickness of the barcodeDescriptionThe thickness of the barcode in pixels. This is the vertical size. -
label={
label } — Sets the labelDescriptionThe text label will be written below or above the barcode depending on the barcode. You can write the special valueBakeryBarcode1D.Label if you would like your text to be chosen automatically. It will be the value passed to thetext={} method. -
font={
font } — Sets the text font for the labelDescriptionThe value of the argument must be an instance of theBakeryFontFile class. -
displayChecksum={
display } — Specifies the checksum to be added to the labelDescriptionSettingtrue will append the checksum to the default label.
The default value is true.
-
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.