A <barcode> tag is often used within a templating system or PDF generator to dynamically create barcodes with various encoding types, including QR codes, Code 128, UPC, and more.
- The codetype attribute specifies the type of barcode being generated. We can give different barcode types.
- The showtext attribute controls whether the text value represented by the barcode will be shown below the barcode. If the value is set to “true” the text contained in the QR code will be printed below it, if “false”, then the text will not be shown below the qr code.
- The value attribute contains the data that will be encoded into the QR code. This determines what information the barcode will hold.
<barcode codetype=”code128″ height=’75’ width=’75’ showtext=”true” value=”The barcode displays this value.”/>
The different code types are
- QR Code: A two-dimensional barcode that can store large amounts of data, including alphanumeric characters, binary data, and URLs.
- Code 128: A high-density linear barcode capable of encoding alphanumeric characters, including ASCII values 0 to 127.
- Universal Product Code: A widely recognized linear barcode used primarily for retail product identification. The standard UPC-A barcode encodes 12 numeric digits.
- Code 39: A 1D barcode that encodes alphanumeric characters.