-
Notifications
You must be signed in to change notification settings - Fork 9
CODE128
Bunlong VAN edited this page Jun 5, 2020
·
3 revisions
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 useBarcode will choose if nothing else is specified.
useBarcode("#barcode", "Example1234"); //CODE128 (auto) is the default mode
useBarcode("#barcode", "Example1234", {format: "CODE128"}); //But you can still specify it
If the barcode scanner only support one type of CODE128 you can force that mode.
useBarcode("#barcode", "EXAMPLE\n1234", {format: "CODE128A"});
useBarcode("#barcode", "Example1234", {format: "CODE128B"});
useBarcode("#barcode", "12345678", {format: "CODE128C"});
Enable encoding CODE128 as GS1-128/EAN-128.
useBarcode("#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
useBarcode("#barcode", "\n\t\r");
useBarcode("#barcode", "\x0A\x09\x0D");
useBarcode("#barcode", String.fromCharCode(10, 9, 13));
For information about all ASCII character, see ASCIItable.com.