-
Notifications
You must be signed in to change notification settings - Fork 1.1k
CODE128
mayjiangfei edited this page Sep 23, 2019
·
6 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 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 it
If 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.
- Home
- Options
- Setup
- Browser Setup
- Node Setup
- Barcodes
- CODE128
- EAN / UPC
- CODE39
- ITF-14
- MSI
- Pharmacode
- Codabar