<HTML>
<BODY>
<STYLE TYPE="text/css" media="screen,print">
@font-face {
font-family: CCode39_S3;
src: url("fonts/ConnectCode39_S3.woff") format("woff");
}
.barcode {font-family: 'CCode39_S3'; font-size: 32px}
</STYLE>
<div id="barcode">*12345678*</div>
</BODY>
</HTML>
|
<html lang="en">
<head>
<meta charset="utf-8" />
<title>TypeScript HTML App</title>
<link rel="stylesheet" href="app.css" type="text/css" />
<script src="barcodescripts/barcode.js"></script>
<script src="barcodescripts/code39.js"></script>
<style type="text/css" media="screen,print">
@font-face {
font-family: CCode39;
src: url("barcodefonts/ConnectCode39_S3_Trial.eot");
src: local("CCode39_S3_Trial"),
url("barcodefonts/ConnectCode39_S3_Trial.otf") format("opentype"),
url("barcodefonts/ConnectCode39_S3_Trial.woff") format("woff");
}
div.barcodeData {
white-space:pre; /*mandatory*/
font-weight: normal;
font-style: normal;
line-height: normal;
font-family: 'CCode39', sans-serif;
font-size: 32px;
}
</style>
</head>
<body>
<h2>Code39 Barcode</h2>
<center>
<div class="barcodeData">12345678</div>
<div class="humanReadableText"></div>
</center>
<script src="app-code39.js"></script>
</body>
</html>
|
window.onload = function () {
varelementBarcode = document.getElementsByClassName("barcodeData");
varelementHumanReadableText = document.getElementsByClassName("humanReadableText");
for (var x = 0; x <elementBarcode.length; x++) {
var barcode = new Code39(elementBarcode[x].innerHTML);
var result = barcode.encode();
var hrText = barcode.getHRText();
elementBarcode[x].innerHTML = result;
elementHumanReadableText[x].innerHTML = hrText;
}
};
|
|
encode() - encode and generate barcode characters getHRText() - return the Human Readable Text of a barcode |
|
Codabar Javascript File - codabar.js Javascript Class - Codabar(data) data is of type string. Code 39 Javascript File - code39.js Javascript Class - Code39(data, checkDigit) data is of type string and checkDigit is of type boolean. Code39 Ascii Javascript File - code39ascii.js Javascript Class - Code39ASCII(data, checkDigit) data is of type string and checkDigit is of type boolean. Code93 Javascript File - code93.js Javascript Class - Code93(data, checkDigit) data is of type string and checkDigit is of type boolean. Code128 A Javascript File - code128a.js Javascript Class - Code128A(data) data is of type string. Code128 B Javascript File - code128b.js Javascript Class - Code128B(data) data is of type string. Code128 C Javascript File - code128c.js Javascript Class - Code128C(data) data is of type string. Code128 Auto Javascript File - code128auto.js Javascript Class - Code128Auto(data) data is of type string. UCCEAN Javascript File - uccean.js Javascript Class - UCCEAN(data, gs1Compliance) data is of type string and gs1Compliance is of type boolean. By default, gs1Compliance is true. Set the value to false to support legacy systems. I2of5 Javascript File - i2of5.js Javascript Class - I2of5(data, checkDigit) data is of type string. Industrial 2of5 Javascript File - industrial2of5.js Javascript Class - Industrial2of5(data, checkDigit) data is of type string and checkDigit is of type boolean. ITF14 Javascript File - itf14.js Javascript Class - ITF14(data, checkDigit, itfRectangle) data is of type string, checkDigit is of type boolean itfRectangle is of type boolean. itfRectangle specifies whether to use a rectangle to fully enclose the ITF14 barcode as specified in the specifications. Modified Plessy Javascript File - modifiedplessy.js Javascript Class - ModifiedPlessy(data, checkDigit) data is of type string and checkDigit is of type boolean. EAN13 Javascript File - ean13.js Javascript Class - EAN13(data, hr) data is of type string and hr is of type boolean. If a font with Embedded Human Readable Text (e.g. UPCEAN_HRBS3) font is used, the hr option must be set to true. EAN8 Javascript File - ean8.js Javascript Class - EAN8(data, hr) data is of type string and hr is of type boolean. If a font with Embedded Human Readable Text (e.g. UPCEAN_HRBS3) font is used, the hr option must be set to true. UPCA Javascript File - upca.js Javascript Class - UPCA(data, hr) data is of type string and hr is of type boolean. If a font with Embedded Human Readable Text (e.g. UPCEAN_HRBS3) font is used, the hr option must be set to true. UPCE Javascript File - upce.js Javascript Class - UPCE(data, hr) data is of type string and hr is of type boolean. If a font with Embedded Human Readable Text (e.g. UPCEAN_HRBS3) font is used, the hr option must be set to true. EXT2 Javascript File - ext2.js Javascript Class - EXT2(data) data is of type string. Embedded Human Readable Text (e.g. CCodeUPCEAN_HRBS3) fonts can be applied without any further options. EXT5 Javascript File - ext5.js Javascript Class - EXT5(data) data is of type string. Embedded Human Readable Text (e.g. CCodeUPCEAN_HRBS3) fonts can be applied without any further options. GS1 Databar 14 Javascript File - gs1databar14.js Javascript Class - GS1Databar14(data, linkage) data is of type string and linkage is of type boolean. If the linkage flag is set to false, then the GS1 Databar 14 stands alone, otherwise a 2D barcode component is associated with this GS1 Databar 14 barcode. |
module net {
export module connectcode {
export interface Barcode {
encode(): string;
getHRText(): string;
}
}
|
|
Codabar TypeScript File - codabar.ts TypeScript Class - Codabar(data: string) Code 39 TypeScript File - code39.ts TypeScript Class - Code39(data: string, checkDigit: boolean=false) Code39 Ascii TypeScript File - code39ascii.ts TypeScript Class - Code39ASCII(data: string, checkDigit: boolean=false) Code93 TypeScript File - code93.ts TypeScript Class - Code93(data: string, checkDigit: boolean=false) Code128 A TypeScript File - code128a.ts TypeScript Class - Code128A(data: string) Code128 B TypeScript File - code128b.ts TypeScript Class - Code128B(data: string) Code128 C TypeScript File - code128c.ts TypeScript Class - Code128C(data: string) Code128 Auto TypeScript File - code128auto.ts TypeScript Class - Code128Auto(data: string) UCCEAN TypeScript File - uccean.ts TypeScript Class - UCCEAN(data: string, gs1Compliance: boolean=true) By default, gs1Compliance is true. Set the value to false to support legacy systems. I2of5 TypeScript File - i2of5.ts TypeScript Class - I2of5(data: string, checkDigit: boolean=false) Industrial 2of5 TypeScript File - industrial2of5.ts TypeScript Class - Industrial2of5(data: string, checkDigit: boolean=false) ITF14 TypeScript File - itf14.ts TypeScript Class - ITF14(data: string, checkDigit: boolean=false, itfRectangle: boolean=false) itfRectangle specifies whether to use a rectangle to fully enclose the ITF14 barcode as specified in the specifications. Modified Plessy TypeScript File - modifiedplessy.ts TypeScript Class - ModifiedPlessy(data: string, checkDigit: boolean=false) EAN13 TypeScript File - ean13.ts TypeScript Class - EAN13(data: string, hr:boolean=false) If a font with Embedded Human Readable Text (e.g. UPCEAN_HRBS3) font is used, the hr option must be set to true. EAN8 TypeScript File - ean8.ts TypeScript Class - EAN8(data: string, hr:boolean=false) If a font with Embedded Human Readable Text (e.g. UPCEAN_HRBS3) font is used, the hr option must be set to true. UPCA TypeScript File - upca.ts TypeScript Class - UPCA(data: string, hr:boolean=false) If a font with Embedded Human Readable Text (e.g. UPCEAN_HRBS3) font is used, the hr option must be set to true. UPCE TypeScript File - upce.ts TypeScript Class - UPCE(data: string, hr:boolean=false) If a font with Embedded Human Readable Text (e.g. UPCEAN_HRBS3) font is used, the hr option must be set to true. EXT2 TypeScript File - ext2.ts TypeScript Class - EXT2(data: string) data is of type string. Embedded Human Readable Text (e.g. CCodeUPCEAN_HRBS3) fonts can be applied without any further options. EXT5 TypeScript File - ext5.ts TypeScript Class - EXT5(data: string) data is of type string. Embedded Human Readable Text (e.g. CCodeUPCEAN_HRBS3) fonts can be applied without any further options. GS1 Databar 14 TypeScript File - gs1databar14.ts TypeScript Class - GS1Databar14(data: string, linkage: boolean=false) If the linkage flag is set to false, then the GS1 Databar 14 stands alone, otherwise a 2D barcode component is associated with this GS1 Databar 14 barcode. |