Search in sources :

Example 11 with BarCodeBuilder

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

the class GenerateAztecBarcode method main.

public static void main(String[] args) {
    // The path to the resource directory.
    String dataDir = Utils.getDataDir(GenerateAztecBarcode.class) + "TwoD_barcodes/BasicFeatures/";
    // Initialize BarCode builder class object
    BarCodeBuilder builder = new BarCodeBuilder();
    // Set the barcode text
    builder.setCodeText("25");
    // Set symbology type as Aztec
    builder.setEncodeType(com.aspose.barcode.EncodeTypes.AZTEC);
    // save barcode
    builder.save(dataDir + "Aztec.png");
}
Also used : BarCodeBuilder(com.aspose.barcode.BarCodeBuilder)

Example 12 with BarCodeBuilder

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

the class SetAztecSymbolMode method main.

public static void main(String[] args) {
    // The path to the resource directory.
    String dataDir = Utils.getDataDir(SetAztecSymbolMode.class) + "TwoD_barcodes/BasicFeatures/";
    // Create an instance of BarCodeBuilder class.
    BarCodeBuilder b = new BarCodeBuilder();
    // Set the Code text.
    b.setCodeText("25");
    // Set the barcode type.
    b.setEncodeType(com.aspose.barcode.EncodeTypes.AZTEC);
    // set the AztecSymbolMode property.
    b.setAztecSymbolMode(AztecSymbolMode.Rune);
    // Save the barcode as PNG image.
    b.save(dataDir + "testRune25.png");
}
Also used : BarCodeBuilder(com.aspose.barcode.BarCodeBuilder)

Example 13 with BarCodeBuilder

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

the class HidingCodeTextThatIsTooLongToDisplay method hideTheBarcodeCodeText.

public static void hideTheBarcodeCodeText(String dataDir) throws IOException {
    BarCodeBuilder b = new BarCodeBuilder();
    b.setEncodeType(com.aspose.barcode.EncodeTypes.DATA_MATRIX);
    b.setCodeText("The quick brown fox jumps over the lazy dog\n The quick brown fox jumps over the lazy dog\n");
    b.setCodeLocation(CodeLocation.Below);
    b.save(dataDir + "datamatrix.bmp", BarCodeImageFormat.Bmp);
}
Also used : BarCodeBuilder(com.aspose.barcode.BarCodeBuilder)

Example 14 with BarCodeBuilder

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

the class SetAspectRatioOfBarcodes method main.

public static void main(String[] args) {
    String dataDir = Utils.getDataDir(SetAspectRatioOfBarcodes.class) + "2DBarcode/UtilityFeatures/";
    // Create instance of BarCodeBuilder class
    BarCodeBuilder builder = new BarCodeBuilder("1234567890", com.aspose.barcode.EncodeTypes.PDF_417);
    // Set Aspect Ratio to 3:2 or 1.5
    builder.setAspectRatio(1.5f);
    // Save the barcode image to disk in PNG format
    builder.save(dataDir + "barcode_aspect_ratio.png");
}
Also used : BarCodeBuilder(com.aspose.barcode.BarCodeBuilder)

Example 15 with BarCodeBuilder

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

the class ColorizeBarcodeImage method main.

public static void main(String[] args) {
    // The path to the resource directory.
    String dataDir = Utils.getDataDir(ColorizeBarcodeImage.class) + "BarcodeImage/BasicFeatures/";
    BarCodeBuilder bb = new BarCodeBuilder();
    bb.setCodeText("1234567");
    bb.setEncodeType(com.aspose.barcode.EncodeTypes.CODE_128);
    // Set background color of the barcode
    bb.setBackColor(Color.YELLOW);
    // Set the foreground color of the barcode
    bb.setForeColor(Color.BLUE);
    // Set border's color
    bb.setBorderColor(Color.RED);
    // Set the code text's color
    bb.setCodeTextColor(Color.RED);
    // Caption's color
    bb.getCaptionAbove().setForeColor(Color.darkGray);
    bb.getCaptionBelow().setForeColor(Color.CYAN);
    // Save the image
    bb.save(dataDir + "colorizeBarcode.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