use of com.aspose.barcode.BarCodeBuilder in project Aspose.BarCode-for-Java by aspose-barcode.
the class CreatingAnAztecBarcode method errorCorrection.
public static void errorCorrection(String dataDir) throws IOException {
BarCodeBuilder b = new BarCodeBuilder();
b.setEncodeType(com.aspose.barcode.EncodeTypes.AZTEC);
b.setAztectErrorLevel(50);
b.setCodeText("1234567890");
b.save(dataDir + "error_correction_aztec.bmp", BarCodeImageFormat.Bmp);
}
use of com.aspose.barcode.BarCodeBuilder in project Aspose.BarCode-for-Java by aspose-barcode.
the class Checksum method main.
public static void main(String[] args) {
// The path to the resource directory.
String dataDir = Utils.getDataDir(Checksum.class) + "Barcode/AdvancedFeatures/";
BarCodeBuilder bb = new BarCodeBuilder();
bb.setCodeText("1234567");
bb.setEncodeType(com.aspose.barcode.EncodeTypes.CODE_39_STANDARD);
// Make the checksum to be visible on the barcode
bb.setEnableChecksum(EnableChecksum.Default);
// Save the Barcode image to file
bb.save(dataDir + "checksum.jpg");
}
use of com.aspose.barcode.BarCodeBuilder in project Aspose.BarCode-for-Java by aspose-barcode.
the class GenerateAPatchCode method generateWholePage.
public static void generateWholePage() throws IOException {
BarCodeBuilder builder = new BarCodeBuilder("Patch T", com.aspose.barcode.EncodeTypes.PATCH_CODE);
// in millimeters
builder.setImageWidth(150);
// make the same small margins
builder.setMargins(new MarginsF(0.5f, 0.5f, 0.5f, 0.5f));
// to hide codetext
builder.setCodeLocation(CodeLocation.None);
BufferedImage topImg = builder.generateBarCodeImage();
builder.rotate(90);
BufferedImage leftImg = builder.generateBarCodeImage();
builder.rotate(90);
BufferedImage bottomImg = builder.generateBarCodeImage();
builder.rotate(90);
BufferedImage rigthtImg = builder.generateBarCodeImage();
BufferedImage frameImg = new BufferedImage(topImg.getWidth(), rigthtImg.getHeight() + 2 * topImg.getHeight(), rigthtImg.getType());
// Initialize graphics object from the image
Graphics graphics = frameImg.getGraphics();
graphics.drawImage(topImg, 0, 0, null);
graphics.drawImage(leftImg, 0, topImg.getHeight(), null);
graphics.drawImage(bottomImg, 0, topImg.getHeight() + leftImg.getHeight(), null);
graphics.drawImage(rigthtImg, topImg.getWidth() - rigthtImg.getWidth(), topImg.getHeight(), null);
// save Patch code frame
File outputfile = new File(Utils.getDataDir(GenerateAPatchCode.class) + "Barcode/AdvancedFeatures/" + "patch-code-frame.png");
ImageIO.write(frameImg, "png", outputfile);
}
use of com.aspose.barcode.BarCodeBuilder in project Aspose.BarCode-for-Java by aspose-barcode.
the class GenerateAPatchCode method generatePatchCode.
public static void generatePatchCode() {
// The path to the resource directory.
String dataDir = Utils.getDataDir(GenerateAPatchCode.class) + "Barcode/AdvancedFeatures/";
BarCodeBuilder builder = new BarCodeBuilder();
// set Symbology type
builder.setEncodeType(com.aspose.barcode.EncodeTypes.PATCH_CODE);
builder.setCodeText("Patch T");
builder.save(dataDir + "patch.bmp");
}
use of com.aspose.barcode.BarCodeBuilder in project Aspose.BarCode-for-Java by aspose-barcode.
the class GenerateAustraliaPostBarcode method main.
public static void main(String[] args) {
// The path to the resource directory.
String dataDir = Utils.getDataDir(GenerateAustraliaPostBarcode.class) + "Barcode/AdvancedFeatures/";
// Create instance of BarCodeBuilder, specify code-text and Symbology in the constructor
BarCodeBuilder builder = new BarCodeBuilder("1234567890", com.aspose.barcode.EncodeTypes.AUSTRALIA_POST);
// Save the image to disk in PNG format
builder.save(dataDir + "australiaPostBarcode.png");
}
Aggregations