Search in sources :

Example 56 with BarCodeBuilder

use of com.aspose.barcode.BarCodeBuilder in project Aspose.BarCode-for-Java by aspose-barcode.

the class AsposeAPI method createAsposeBarCode.

public static void createAsposeBarCode(String billAmount, ServletOutputStream out, String symbology) {
    BarCodeBuilder bb = new BarCodeBuilder();
    // Set up code text (data to be encoded)
    bb.setCodeText(billAmount);
    // Set up code text color
    bb.setCodeTextColor(java.awt.Color.RED);
    // Set the location of the code text to above the barcode
    bb.setCodeLocation(CodeLocation.Above);
    // Increase the space between code text and barcode to 1 point
    bb.setCodeTextSpace(1.0f);
    // Set the symbology type
    bb.setSymbologyType(Long.valueOf(symbology));
    bb.save(out, BarCodeImageFormat.Png);
}
Also used : BarCodeBuilder(com.aspose.barcode.BarCodeBuilder)

Aggregations

BarCodeBuilder (com.aspose.barcode.BarCodeBuilder)56 BufferedImage (java.awt.image.BufferedImage)4 File (java.io.File)3 MarginsF (com.aspose.barcode.MarginsF)2 Font (java.awt.Font)2 Graphics (java.awt.Graphics)2 Image (java.awt.Image)2 Caption (com.aspose.barcode.Caption)1 EnableChecksum (com.aspose.barcode.EnableChecksum)1 Resolution (com.aspose.barcode.Resolution)1 BarCodeReader (com.aspose.barcode.barcoderecognition.BarCodeReader)1 MediaTracker (java.awt.MediaTracker)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 IOException (java.io.IOException)1 OutputStream (java.io.OutputStream)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1