# barcode element

Type: | Images and Specials
Attributes: | bar-ratio • bar-width • codetype • name • showtext • value • align • background-color • background-image-dpi • background-image-position • background-image • background-pdf • border-color • border-style • border-width • border • clear • corner-radius • display • float • font-size • height • href • left • line-cap • line-height • line-join • margin • onmouseover • overflow • padding • page-break-after • page-break-inside • position • rotate • size • top • vertical-align • visibility • white-space • width • class • colorspace • direction • id • lang

Draw a barcode in the document.
The width and height of the barcode on the page are determined by the value of the code, the codetype attribute and the bar-width. The height is dependent on the width, and whether the showtext attribute is set.
The value attribute is the text to encode as a barcode. Not every character can be encoded, depending on the codetype chosen - for instance, the "code25" attribute can only encode digits. If any characters can't be encoded, an error is given. This attribute is mandatory.
The codetype attribute is the bar code type to use. It is mandatory
The bar-width attribute is the width of the narrowest bar in the code, and defaults to 1. The minimum value is 0.6.
The showtext attribute enables or disables a human-readable version of the barcode, printed immediately below the code itself. For some barcodes, like "upc-a" and "ean-13", this is always set to "true"

    <barcode codetype="code128" value="product123"/>