-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Options
Johan Lindell edited this page Apr 24, 2016
·
24 revisions
The width option is the width of a single bar.
JsBarcode("#barcode", "Smallest width", {
width: 1
});
JsBarcode("#barcode", "Wider barcode", {
width: 3
});
The height of the barcode.
JsBarcode("#barcode", "Wider barcode", {
height: 150
});
JsBarcode("#barcode", "Smallest width", {
height: 25
});
Select which barcode type to use. Please check the wikipage of the different barcode types for more information.
JsBarcode("#barcode", "123456789012", {
format: "EAN13"
});
JsBarcode("#barcode", "123456789012", {
format: "CODE39"
});
With fontOptions you can add bold or italic text to the barcode.
JsBarcode("#barcode", "Bold text", {
fontOptions: "bold"
});
JsBarcode("#barcode", "Italic text", {
fontOptions: "italic"
});
JsBarcode("#barcode", "Both options", {
fontOptions: "bold italic"
});
Define the font used for the text in the generated barcode. This can be any default font or a font defined by a @font-face rule.
JsBarcode("#barcode", "Fantasy font", {
font: "fantasy"
});
Set the horizontal alignment of the text. Can be left / center / right.
JsBarcode("#barcode", "Left text", {
textAlign: "left"
});
Set the vertical position of the text. Can be bottom / top.
JsBarcode("#barcode", "Top text", {
textPosition: "top"
});
Set the space between the barcode and the text.
JsBarcode("#barcode", "Text margin", {
textMargin: 25
});
Set the size of the text.
JsBarcode("#barcode", "Bigger text", {
fontSize: 40
});
Set the background of the barcode.
JsBarcode("#barcode", "Blue background", {
background: "#ccffff"
});
Set the color of the bars and the text.
JsBarcode("#barcode", "Red lines", {
lineColor: "#990000"
});
- Home
- Options
- Setup
- Browser Setup
- Node Setup
- Barcodes
- CODE128
- EAN / UPC
- CODE39
- ITF-14
- MSI
- Pharmacode
- Codabar