Set Start and Stop Symbols of Codabar Barcode

Programming Sample

In the code below, we set A as the start symbol and D as the stop symbol for the Codabar barcode.

Java

 public class MyAttributes

{

    public static BarCodeAttributes Create(String text, String symbology)

    {

        BarCodeAttributes b = new BarCodeAttributes();

        b.setCodeText(text);

        b.setSymbology(symbology);

        b.setCodabarStartSymbol(CodabarSymbol.A);

        b.setCodabarStopSymbol(CodabarSymbol.D);

        return b;

    }

}

JRXML

 <image hAlign="Center">

<reportElement x="0" y="600"  width="500" height="250" />

<imageExpression class="net.sf.jasperreports.engine.JRRenderable">

   <![CDATA[new com.aspose.barcode.jr.BarCodeRenderer(MyAttributes.Create(

      "12345678", "CODABAR")

   )]]>

</imageExpression>

</image>