Manual - ISBN-10 / ISBN-13
Introduction
ISBN code is used to keep a track of the books in the marketplace. It is based on EAN-13 code. An ISBN code can contain 10 characters, in this case, 978 or 979 will be prefixed to encode in the EAN-13 mode.
The hyphens are optional and are different depending on the distribution agency. You may include them, but they will be ignored when read. Barcode Bakery inserts some hyphens in order to look similar to ISBN text.
In order to change the ISBN top label, start by removing the labels with
This class inherits the BakeryBarcode1D class.
Example
Methods
BakeryIsbn's Methods
-
gs1={
gs1 } — Specifies which characters will be prefixed
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 { BakeryIsbn } 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 <BakeryIsbn
scale={2}
thickness={30}
foregroundColor={colorBlack}
backgroundColor={colorWhite}
font={font}
text='9780672326970'
>;
}
Method explanations
-
gs1={
gs1 } — Specifies which characters will be prefixedDescriptionThe different values for this argument are:
-BakeryIsbn.Auto : Does the same thing asBakeryIsbn.Prefix978
-BakeryIsbn.Prefix978 : Adds 978 in front of the code
-BakeryIsbn.Prefix979 : Adds 979 in front of the code
-
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.