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");
}
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");
}
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);
}
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");
}
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");
}
Aggregations