barcode element

Type:Images and Specials
Attributes: bar-ratio  •  bar-width  •  codetype  •  columns  •  ecc  •  name  •  showtext  •  value  •  align  •  alt  •  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  •  title  •  top  •  vertical-align  •  visibility  •  white-space  •  width  •  class  •  colorspace  •  direction  •  id  •  lang  •  pdf-tag-background-color  •  pdf-tag-border-color  •  pdf-tag-border-style  •  pdf-tag-border-thickness  •  pdf-tag-color  •  pdf-tag-list-numbering  •  pdf-tag-placement  •  pdf-tag-table-colspan  •  pdf-tag-table-headers  •  pdf-tag-table-rowspan  •  pdf-tag-table-scope  •  pdf-tag-table-summary  •  pdf-tag-text-align  •  pdf-tag-type

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"/>