Barcode Generation
This commit is contained in:
18
node_modules/jsbarcode/test/browser/canvasTest.html
generated
vendored
Normal file
18
node_modules/jsbarcode/test/browser/canvasTest.html
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Test minified version</title>
|
||||
<script src="../../dist/JsBarcode.all.js"></script>
|
||||
|
||||
<script src="tests.js"></script>
|
||||
<script src="canvasTest.js"></script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="test.css">
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
doTests(document.body);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
30
node_modules/jsbarcode/test/browser/canvasTest.js
generated
vendored
Normal file
30
node_modules/jsbarcode/test/browser/canvasTest.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
var parent;
|
||||
function doTests(p){
|
||||
parent = p;
|
||||
createTests(newTest);
|
||||
}
|
||||
|
||||
function newTest(text, options){
|
||||
var testbox = document.createElement("div");
|
||||
testbox.className = "testbox";
|
||||
|
||||
var format = (typeof options !== "undefined" && options.format) || "auto";
|
||||
|
||||
testbox.innerHTML = '\
|
||||
<b>Format:</b> ' + format + '<br>\
|
||||
<b>Input:</b> ' + text + '<br>\
|
||||
<br>\
|
||||
<img class="barcode"/>';
|
||||
|
||||
try{
|
||||
JsBarcode(testbox.querySelector('.barcode'), text, options);
|
||||
}
|
||||
catch(e){
|
||||
testbox.className = "errorbox";
|
||||
testbox.onclick = function(){
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
parent.appendChild(testbox);
|
||||
}
|
||||
9842
node_modules/jsbarcode/test/browser/help/jquery-2.2.3.js
generated
vendored
Normal file
9842
node_modules/jsbarcode/test/browser/help/jquery-2.2.3.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
80
node_modules/jsbarcode/test/browser/initTest.html
generated
vendored
Normal file
80
node_modules/jsbarcode/test/browser/initTest.html
generated
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Test minified version</title>
|
||||
<script src="help/jquery-2.2.3.js"></script>
|
||||
<script src="../../dist/JsBarcode.all.js"></script>
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: "OCRB";
|
||||
src: url("help/OCRB.otf");
|
||||
}
|
||||
|
||||
body{
|
||||
font-family: "OCRB";
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
window.onload = function(){
|
||||
JsBarcode(".barcode").init();
|
||||
|
||||
$(".jqbarcode").JsBarcode().init();
|
||||
|
||||
JsBarcode("#barcode1").init();
|
||||
$("#barcode2").JsBarcode().init();
|
||||
JsBarcode("#barcode3").init();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<svg class="barcode"
|
||||
jsbarcode-value="123456789010"
|
||||
jsbarcode-format="ean13"
|
||||
jsbarcode-textMargin="0"
|
||||
jsbarcode-lineColor="#e00">
|
||||
</svg>
|
||||
|
||||
<img class="barcode" data-value="Test"/>
|
||||
|
||||
<canvas class="barcode"
|
||||
data-value="HI"
|
||||
data-format="CODE39"
|
||||
data-background="#bff">
|
||||
</canvas>
|
||||
|
||||
<br />
|
||||
|
||||
<svg class="jqbarcode"
|
||||
jsbarcode-value="123456789010"
|
||||
jsbarcode-format="ean13"
|
||||
jsbarcode-textMargin="0"
|
||||
jsbarcode-lineColor="#e00">
|
||||
</svg>
|
||||
|
||||
<img class="jqbarcode" data-value="Test"/>
|
||||
|
||||
<canvas class="jqbarcode"
|
||||
data-value="HI"
|
||||
data-format="CODE39"
|
||||
data-background="#bff">
|
||||
</canvas>
|
||||
|
||||
<br />
|
||||
|
||||
<svg id="barcode1"
|
||||
jsbarcode-value="123456789010"
|
||||
jsbarcode-format="ean13"
|
||||
jsbarcode-textMargin="0"
|
||||
jsbarcode-lineColor="#e00">
|
||||
</svg>
|
||||
|
||||
<img id="barcode2" data-value="Test"/>
|
||||
|
||||
<canvas id="barcode3"
|
||||
data-value="HI"
|
||||
data-format="CODE39"
|
||||
data-background="#bff">
|
||||
</canvas>
|
||||
</body>
|
||||
</html>
|
||||
20
node_modules/jsbarcode/test/browser/jQueryTest.html
generated
vendored
Normal file
20
node_modules/jsbarcode/test/browser/jQueryTest.html
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Test minified version</title>
|
||||
<script src="help/jquery-2.2.3.js"></script>
|
||||
|
||||
<script src="../../dist/JsBarcode.all.js"></script>
|
||||
|
||||
<script src="tests.js"></script>
|
||||
<script src="jQueryTest.js"></script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="test.css">
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
doTests(document.body);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
30
node_modules/jsbarcode/test/browser/jQueryTest.js
generated
vendored
Normal file
30
node_modules/jsbarcode/test/browser/jQueryTest.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
var parent;
|
||||
function doTests(p){
|
||||
parent = p;
|
||||
createTests(newTest);
|
||||
}
|
||||
|
||||
function newTest(text, options){
|
||||
var testbox = document.createElement("div");
|
||||
testbox.className = "testbox";
|
||||
|
||||
var format = (typeof options !== "undefined" && options.format) || "auto";
|
||||
|
||||
testbox.innerHTML = '\
|
||||
<b>Format:</b> ' + format + '<br>\
|
||||
<b>Input:</b> ' + text + '<br>\
|
||||
<br>\
|
||||
<img class="barcode"/>';
|
||||
|
||||
try{
|
||||
$('.barcode', testbox).JsBarcode(text, options);
|
||||
}
|
||||
catch(e){
|
||||
testbox.className = "errorbox";
|
||||
testbox.onclick = function(){
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
parent.appendChild(testbox);
|
||||
}
|
||||
18
node_modules/jsbarcode/test/browser/svgTest.html
generated
vendored
Normal file
18
node_modules/jsbarcode/test/browser/svgTest.html
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Test minified version</title>
|
||||
<script src="../../dist/JsBarcode.all.js"></script>
|
||||
|
||||
<script src="tests.js"></script>
|
||||
<script src="svgTest.js"></script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="test.css">
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
doTests(document.body);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
30
node_modules/jsbarcode/test/browser/svgTest.js
generated
vendored
Normal file
30
node_modules/jsbarcode/test/browser/svgTest.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
var parent;
|
||||
function doTests(p){
|
||||
parent = p;
|
||||
createTests(newTest);
|
||||
}
|
||||
|
||||
function newTest(text, options){
|
||||
var testbox = document.createElement("div");
|
||||
testbox.className = "testbox";
|
||||
|
||||
var format = (typeof options !== "undefined" && options.format) || "auto";
|
||||
|
||||
testbox.innerHTML = '\
|
||||
<b>Format:</b> ' + format + '<br>\
|
||||
<b>Input:</b> ' + text + '<br>\
|
||||
<br>\
|
||||
<svg class="barcode"/>';
|
||||
|
||||
try{
|
||||
JsBarcode(testbox.querySelector('.barcode'), text, options);
|
||||
}
|
||||
catch(e){
|
||||
testbox.className = "errorbox";
|
||||
testbox.onclick = function(){
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
parent.appendChild(testbox);
|
||||
}
|
||||
20
node_modules/jsbarcode/test/browser/test.css
generated
vendored
Normal file
20
node_modules/jsbarcode/test/browser/test.css
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
body{
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
.testbox{
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
margin:25px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.errorbox{
|
||||
background: #d00;
|
||||
vertical-align: top;
|
||||
display: inline-block;
|
||||
margin:25px;
|
||||
padding: 25px;
|
||||
width:100px;
|
||||
text-align: center;
|
||||
}
|
||||
45
node_modules/jsbarcode/test/browser/tests.js
generated
vendored
Normal file
45
node_modules/jsbarcode/test/browser/tests.js
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
function createTests(newTest){
|
||||
newTest("This has a \nnewline", {width: 1});
|
||||
newTest("\tHi\nHI", {width: 1});
|
||||
newTest("Hello", {width: 1, text: "Hi!"});
|
||||
newTest("A little test!", {format: "CODE128", width: 1});
|
||||
newTest("ABCDEFG", {format: "CODE39", width: 1, mod43: true});
|
||||
newTest("A little test", {format: "CODE39", width: 1});
|
||||
newTest("12345", {format: "EAN5", width: 1});
|
||||
newTest("52", {format: "EAN2", width: 1});
|
||||
newTest("423514346455", {format: "UPC", width: 2, textMargin: 0});
|
||||
newTest("423514346455", {format: "UPC", width: 2, textMargin: 0, flat: true});
|
||||
newTest("01245714", {format: "UPCE", width: 2, textMargin: 0});
|
||||
newTest("5901234123457", {format: "EAN13", fontSize: 40, textMargin: 0, lastChar: ">"});
|
||||
newTest("590123412345", {format: "EAN13", width: 2, fontSize: 16});
|
||||
newTest("590123412345", {format: "EAN13", width: 3});
|
||||
newTest("590123412345", {format: "EAN13", flat: true});
|
||||
newTest("96385074", {format: "EAN8", width: 1});
|
||||
newTest("9638507", {format: "EAN8", width: 1});
|
||||
newTest("98765432109213", {format: "ITF14", width: 1});
|
||||
newTest("12345", {format: "pharmacode", width: 1});
|
||||
newTest("133742", {format: "CODE128C", width: 1});
|
||||
newTest("12345674", {format: "MSI", width: 1});
|
||||
newTest("1234567890", {format: "codabar", width: 1});
|
||||
newTest("A1234567890A", {format: "codabar", width: 1});
|
||||
newTest("C1234567890D", {format: "codabar", width: 1});
|
||||
newTest("12345674", {format: "GenericBarcode", width: 1});
|
||||
newTest("Such customize!", {
|
||||
width: 1,
|
||||
height: 50,
|
||||
format: "CODE128",
|
||||
displayValue: true,
|
||||
fontOptions: "bold",
|
||||
font: "cursive",
|
||||
textAlign: "right",
|
||||
textMargin: 20,
|
||||
fontSize: 28,
|
||||
background: "#f00",
|
||||
lineColor: "#0ff",
|
||||
margin: 10,
|
||||
marginTop: 60,
|
||||
marginBottom: 5,
|
||||
marginLeft: 60,
|
||||
marginRight: 30
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user