JS barcode (one-dimensional code) Plug-In JsBarcode Usage Details [encoding type, parameters, attributes], jsjsbarcode
This document describes how to use the JS barcode plug-in JsBarcode. We will share this with you for your reference. The details are as follows:
Here we will introduce the js plug-in for generating code on GitHub → JsBarcode
Bar codes support:
CODE128
CODE128 (automatic mode switch)
CODE128 A/B/C (forced Mode)
EAN
EAN-13
EAN-8
EAN-5
EAN-2
UPC ()
CODE39
ITF-14
MSI
MSI10
MSI11
MSI1010
MSI1110
Pharmacode
Codabar
Code:
<!DOCTYPE html>
JsBarcode we can also set some attributes of the bar code (you can set attributes details link: https://github.com/lindell/JsBarcode/wiki/Options)
<script> JsBarcode ("# imgcode", "123", {format: "CODE39", // select the barcode type to use width: 3, // set the width between bars: 100, // The height displayValue: true, // whether text: "456" is displayed under the bar code, // overwrite the displayed text fontOptions: "bold italic", // bold or italic font: "fantasy", // set the text font textAlign: "left ", // set the text horizontal alignment mode textPosition: "top", // set the text vertical position textMargin: 5, // set the spacing between the barcode and text fontSize: 15, // set the size of the text background: "# eee", // set the background lineColor of the barcode: "#2196f3", // set the size of the bar and text Color. Margin: 15 // set the margin around the bar code}); </script>
GitHub: https://github.com/lindell/JsBarcode
Barcode generator: http://lindell.me/JsBarcode/generator/
JsBarcode example and settings: http://codepen.io/lindell/pen/mPvLXx? Editers = 1010
Simple JsBarcode Demo: http://codepen.io/lindell/pen/eZKBdO? Editers = 1010