Barcode component offers the capability to create diverse barcode types with Barcode4j in both PNG and SVG formats. For browsers lacking SVG support, the component automatically defaults to PNG format.
<dependency>
<groupId>org.primefaces.extensions</groupId>
<artifactId>barcode4j-light</artifactId>
<version>2.3.0</version>
</dependency>
Interleaved 2 of 5 | |
Codabar | |
Code39 | |
Code128 | |
EAN-8 | |
EAN-13 | |
UPC-A (PNG) | |
UPC-E (Vertical) | |
PDF417 | |
DataMatrix | |
Postnet | |
QR |
<div class="card">
<h:panelGrid columns="2" cellpadding="7">
<h:outputText value="Interleaved 2 of 5"/>
<p:barcode value="0123456789" type="int2of5"/>
<h:outputText value="Codabar"/>
<p:barcode value="0123456789" type="codabar"/>
<h:outputText value="Code39"/>
<p:barcode value="0123456789" type="code39"/>
<h:outputText value="Code128"/>
<p:barcode value="0123456789" type="code128"/>
<h:outputText value="EAN-8"/>
<p:barcode value="20123451" type="ean8"/>
<h:outputText value="EAN-13"/>
<p:barcode value="0123456789012" type="ean13"/>
<h:outputText value="UPC-A (PNG)"/>
<p:barcode value="01234567895" type="upca" format="png"/>
<h:outputText value="UPC-E (Vertical)"/>
<p:barcode value="01234133" type="upce" orientation="90"/>
<h:outputText value="PDF417"/>
<p:barcode value="0123456789" type="pdf417"/>
<h:outputText value="DataMatrix"/>
<p:barcode value="0123456789" type="datamatrix"/>
<h:outputText value="Postnet"/>
<p:barcode value="0123456789" type="postnet"/>
<h:outputText value="QR"/>
<p:barcode value="0123456789" type="qr" width="125" height="125"/>
</h:panelGrid>
</div>