The Code 39 character set includes the digits 0-9, the letters A-Z (upper case only), and the symbols: space, minus (-), plus (+), period (.), dollar sign ($), slash (/), and percent (%). A special start / stop character is placed at the beginning and ending of each barcode. The barcode can be of any length; even more than 25 characters begin to push the bounds. Code 39 is the only type of barcode that does not require a checksum for common use.
import { BarcodeGenerator, ValidateEvent } from '@syncfusion/ej2-barcode-generator';
let barcode = new BarcodeGenerator({
width: '200px',
height: '150px',
mode: 'SVG',
type: 'Code39',
value: 'SYNCFUSION',
});
barcode.appendTo('#element');
<!DOCTYPE html>
<html lang="en">
<head>
<title>EJ2 Barcode</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Typescript UI Controls" />
<meta name="author" content="Syncfusion" />
<link href="index.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<script src="systemjs.config.js"></script>
</head>
<style>
.barcodeStyle{
height: 150px;
width: 200px;
padding-left: 40%;
padding-top: 9%;
}
</style>
<body>
<div id='loader'>Loading....</div>
<div id='container'class="barcodeStyle">
<div id='element'></div>
</div>
</body>
</html>
Code 39 Extended is an extended version of Code 39 that supports ASCII character set. In Code 39 Extended, you can also code 26 lower letters (a-z) and the special characters in the keyboard.
import { BarcodeGenerator, ValidateEvent } from '@syncfusion/ej2-barcode-generator';
let barcode = new BarcodeGenerator({
width: '200px',
height: '150px',
mode: 'SVG',
type: 'Code39Extension',
value: 'SYNCFUSION',
});
barcode.appendTo('#element');
<!DOCTYPE html>
<html lang="en">
<head>
<title>EJ2 Barcode</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Typescript UI Controls" />
<meta name="author" content="Syncfusion" />
<link href="index.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<script src="systemjs.config.js"></script>
</head>
<style>
.barcodeStyle{
height: 150px;
width: 200px;
padding-left: 40%;
padding-top: 9%;
}
</style>
<body>
<div id='loader'>Loading....</div>
<div id='container'class="barcodeStyle">
<div id='element'></div>
</div>
</body>
</html>
Code 11 is used primarily for labeling the telecommunication equipment’s. The character set includes the digits 0 to 9, a dash (-), and a start / stop code.
import { BarcodeGenerator, ValidateEvent } from '@syncfusion/ej2-barcode-generator';
let barcode = new BarcodeGenerator({
width: '200px',
height: '150px',
mode: 'SVG',
type: 'Code11',
value: '112',
});
barcode.appendTo('#element');
<!DOCTYPE html>
<html lang="en">
<head>
<title>EJ2 Barcode</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Typescript UI Controls" />
<meta name="author" content="Syncfusion" />
<link href="index.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<script src="systemjs.config.js"></script>
</head>
<style>
.barcodeStyle{
height: 150px;
width: 200px;
padding-left: 40%;
padding-top: 9%;
}
</style>
<body>
<div id='loader'>Loading....</div>
<div id='container'class="barcodeStyle">
<div id='element'></div>
</div>
</body>
</html>
Codabar is a variable length symbol that encodes the following 20 characters:
0123456789-$:/.+ABCD
The characters, A, B, C and D are used as start and stop characters. Codabar is used in libraries, blood banks, the package delivery industry and a variety of other information processing applications.
import { BarcodeGenerator, ValidateEvent } from '@syncfusion/ej2-barcode-generator';
let barcode = new BarcodeGenerator({
width: '200px',
height: '150px',
mode: 'SVG',
type: 'Codabar',
value: '123456789',
});
barcode.appendTo('#element');
<!DOCTYPE html>
<html lang="en">
<head>
<title>EJ2 Barcode</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Typescript UI Controls" />
<meta name="author" content="Syncfusion" />
<link href="index.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<script src="systemjs.config.js"></script>
</head>
<style>
.barcodeStyle{
height: 150px;
width: 200px;
padding-left: 40%;
padding-top: 9%;
}
</style>
<body>
<div id='loader'>Loading....</div>
<div id='container'class="barcodeStyle">
<div id='element'></div>
</div>
</body>
</html>
Code 32 is mainly used for coding pharmaceuticals, cosmetics and dietetics. It is often used to encode Italian Pharmacode that has the following structure:
The value to be encoded must be 8 digits Pharmacode (prefix it with ‘0’ if necessary) and the 9th digit (the checksum) is automatically calculated by barcode.
import { BarcodeGenerator, ValidateEvent } from '@syncfusion/ej2-barcode-generator';
let barcode = new BarcodeGenerator({
type: 'Code32',
value: '01234567',
width: '200px', height: '150px',
mode: 'SVG',
});
barcode.appendTo('#element');
<!DOCTYPE html>
<html lang="en">
<head>
<title>EJ2 Barcode</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Typescript UI Controls" />
<meta name="author" content="Syncfusion" />
<link href="index.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<script src="systemjs.config.js"></script>
</head>
<style>
.barcodeStyle{
height: 150px;
width: 200px;
padding-left: 40%;
padding-top: 9%;
}
</style>
<body>
<div id='loader'>Loading....</div>
<div id='container'class="barcodeStyle">
<div id='element'></div>
</div>
</body>
</html>
Code 93 is designed to complement and improve upon Code 39. It can represent the entire ASCII character set by using combinations of 2 characters. Code 93 is a continuous, variable-length symbology and produces denser code. The Standard Mode (default implementation) can encode uppercase letters (A-Z), digits (0-9), and special characters like *, -, $, %, (Space), ., /, and +.
import { BarcodeGenerator, ValidateEvent } from '@syncfusion/ej2-barcode-generator';
let barcode = new BarcodeGenerator({
type: 'Code93',
value: '01234567',
width: '200px', height: '150px',
mode: 'SVG',
});
barcode.appendTo('#element');
<!DOCTYPE html>
<html lang="en">
<head>
<title>EJ2 Barcode</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Typescript UI Controls" />
<meta name="author" content="Syncfusion" />
<link href="index.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<script src="systemjs.config.js"></script>
</head>
<style>
.barcodeStyle{
height: 150px;
width: 200px;
padding-left: 40%;
padding-top: 9%;
}
</style>
<body>
<div id='loader'>Loading....</div>
<div id='container'class="barcodeStyle">
<div id='element'></div>
</div>
</body>
</html>
The Code 93 Extended Barcode symbology is continuous, variable length, and self-checking. It is based on Code 93 Barcode. The Extended Version can encode all 128 ASCII characters.
Code 128 is a variable length, high density, alphanumeric, linear bar code symbology, capable of encoding the full 128-character ASCII character set and extended character sets. This symbology includes a checksum digit for verification and the barcode can also be verified character-by-character by verifying the parity of each data byte.
The last seven characters of Code Sets A and B (character values 96 - 102) and the last three characters of Code Set C (character values 100 - 102) are special non-data characters with no ASCII character equivalents that have a particular significance to the Barcode reading device.
import { BarcodeGenerator, ValidateEvent } from '@syncfusion/ej2-barcode-generator';
let barcode = new BarcodeGenerator({
type: 'Code128',
value: 'SYNCFUSION',
width: '200px', height: '150px',
mode: 'SVG',
});
barcode.appendTo('#element');
<!DOCTYPE html>
<html lang="en">
<head>
<title>EJ2 Barcode</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Typescript UI Controls" />
<meta name="author" content="Syncfusion" />
<link href="index.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<script src="systemjs.config.js"></script>
</head>
<style>
.barcodeStyle{
height: 150px;
width: 200px;
padding-left: 40%;
padding-top: 9%;
}
</style>
<body>
<div id='loader'>Loading....</div>
<div id='container'class="barcodeStyle">
<div id='element'></div>
</div>
</body>
</html>
A page or printed media with barcode often appears colorful in the background and surrounding region with other contents. In such cases the barcode can also be customized to suit the needs. You can achieve this by using for forecolor property .
import { BarcodeGenerator, ValidateEvent } from '@syncfusion/ej2-barcode-generator';
let barcode = new BarcodeGenerator({
type: 'Code128',
value: 'SYNCFUSION',
width: '200px', height: '150px',
mode: 'SVG',
foreColor:'red',
});
barcode.appendTo('#element');
<!DOCTYPE html>
<html lang="en">
<head>
<title>EJ2 Barcode</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Typescript UI Controls" />
<meta name="author" content="Syncfusion" />
<link href="index.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<script src="systemjs.config.js"></script>
</head>
<style>
.barcodeStyle{
height: 150px;
width: 200px;
padding-left: 40%;
padding-top: 9%;
}
</style>
<body>
<div id='loader'>Loading....</div>
<div id='container'class="barcodeStyle">
<div id='element'></div>
</div>
</body>
</html>
The dimension of the barcode can be changed using the height and width property of the barcodegenerator.
import { BarcodeGenerator, ValidateEvent } from '@syncfusion/ej2-barcode-generator';
let barcode = new BarcodeGenerator({
type: 'Code128',
value: 'SYNCFUSION',
width: '300px', height: '300px',
mode: 'SVG',
});
barcode.appendTo('#element');
<!DOCTYPE html>
<html lang="en">
<head>
<title>EJ2 Barcode</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Typescript UI Controls" />
<meta name="author" content="Syncfusion" />
<link href="index.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<script src="systemjs.config.js"></script>
</head>
<style>
.barcodeStyle{
height: 150px;
width: 200px;
padding-left: 40%;
padding-top: 9%;
}
</style>
<body>
<div id='loader'>Loading....</div>
<div id='container'class="barcodeStyle">
<div id='element'></div>
</div>
</body>
</html>
In barcode generators you can customize the barcode text by using display text property .
import { BarcodeGenerator, ValidateEvent } from '@syncfusion/ej2-barcode-generator';
let barcode = new BarcodeGenerator({
type: 'Code128',
value: 'SYNCFUSION',
width: '200px', height: '150px',
mode: 'SVG',
displayText:{text:'text'},
});
barcode.appendTo('#element');
<!DOCTYPE html>
<html lang="en">
<head>
<title>EJ2 Barcode</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Typescript UI Controls" />
<meta name="author" content="Syncfusion" />
<link href="index.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
<script src="systemjs.config.js"></script>
</head>
<style>
.barcodeStyle{
height: 150px;
width: 200px;
padding-left: 40%;
padding-top: 9%;
}
</style>
<body>
<div id='loader'>Loading....</div>
<div id='container'class="barcodeStyle">
<div id='element'></div>
</div>
</body>
</html>