forked from lindell/JsBarcode
-
Notifications
You must be signed in to change notification settings - Fork 0
CODE128
Bankn8II©$A edited this page May 17, 2025
·
1 revision
CODE128 is one of the more versatile barcodes. It has support for all 128 ASCII characters but does also encode numbers efficiently. It has three modes (A/B/C) but can switch between them at any time. CODE128 is the default barcode that JsBarcode will choose if nothing else is specified.
JsBarcode("#barcode", "Example1234"); //CODE128 (auto) is the default mode
JsBarcode("#barcode", "Example1234", {format: "CODE128"}); //But you can still specify itIf the barcode scanner only support one type of CODE128 you can force that mode.
JsBarcode("#barcode", "EXAMPLE\n1234", {format: "CODE128A"});
JsBarcode("#barcode", "Example1234", {format: "CODE128B"});
JsBarcode("#barcode", "12345678", {format: "CODE128C"});Enable encoding CODE128 as GS1-128/EAN-128.
JsBarcode("#barcode", "12345678", {
format: "CODE128C",
ean128: true
});CODE128 supports all 128 ASCII characters. You can input them in a few ways.
Here comes examples where characters Newline, Horizontal tab and Carriage return
JsBarcode("#barcode", "\n\t\r");
JsBarcode("#barcode", "\x0A\x09\x0D");
JsBarcode("#barcode", String.fromCharCode(10, 9, 13));For information about all ASCII character, see ASCIItable.com.