Manual - PDF417
Introduction
PDF417 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. PDF417 encodes the 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
BakeryPdf417's Methods
-
quietZone={
quietZone } — Specifies to draw a quiet zone around the barcode -
compact={
compact } — Specifies if the barcode must be compact/truncated -
column={
column } — Sets the number of data column -
errorLevel={
level } — Sets the error correction level of the barcode -
ratio={
ratio } — Sets the ratio for printing
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 { BakeryPdf417 } from '@barcode-bakery/barcode-react/pdf417';
export default function Home() {
const colorBlack = new BakeryColor(0, 0, 0);
const colorWhite = new BakeryColor(255, 255, 255);
return <BakeryPdf417
scale={2}
foregroundColor={colorBlack}
backgroundColor={colorWhite}
text='PDF417'
>;
}
Method explanations
-
quietZone={
quietZone } — Specifies to draw a quiet zone around the barcodeDescriptionTo be read correctly, the PDF417 must have a quiet zone around the image. You can, however, turn this off.
The default value is true. -
compact={
compact } — Specifies if the barcode must be compact/truncatedDescriptionCuts the barcode by removing the 2 last columns on the right. Your barcode will be smaller but harder to read.
The default value is false. -
column={
column } — Sets the number of data columnDescriptionSpecifies the number of data columns you want to write. You can spread your data more horizontally than vertically by modifying this parameter.
The number of columns must be between 1 and 30.
Setting the value to -1 makes the barcode calculate this number automatically and optimize it.
The default value is -1. -
errorLevel={
level } — Sets the error correction level of the barcodeDescriptionThis is the error correction level which allows you to detect and correct errors in the barcode.
The level must be between 0 and 8.
Setting this value calculates the error level automatically by trying to obtain optimal error detection.
The number of keywords you write will be restricted depending on the error level you choose. See the technical page for more information.
The default value is -1. -
ratio={
ratio } — Sets the ratio for printingDescriptionSets the ratio for printing. This is used only if the number of columns is chosen automatically since this parameter will affect the number of columns in your barcode.
If the number is under 1, the barcode will be spread more horizontally.
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 public. -
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 public.
-
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.