use of com.aspose.barcode.BarCodeBuilder in project Aspose.BarCode-for-Java by aspose-barcode.
the class PrintingABarcodeImage method main.
public static void main(String[] args) throws PrintException {
// Create instance of BarCodeBuilder, specify codetext and symbology in the constructor
BarCodeBuilder builder = new BarCodeBuilder("12345678", com.aspose.barcode.EncodeTypes.CODE_128);
// Set printer name
builder.setPrinterName("ML-1640 Series");
// start a print job
builder.print();
}
use of com.aspose.barcode.BarCodeBuilder in project Aspose.BarCode-for-Java by aspose-barcode.
the class ManageXAndYDimension method setXDimension.
public static void setXDimension() {
// The path to the resource directory.
String dataDir = Utils.getDataDir(ManageXAndYDimension.class) + "Barcode/AdvancedFeatures/";
BarCodeBuilder bb = new BarCodeBuilder();
bb.setCodeText("12345678");
bb.setEncodeType(com.aspose.barcode.EncodeTypes.CODE_128);
// Set the x-dimension for the bars of the barcode
bb.setxDimension(0.5f);
// Save the Barcode image to file
bb.save(dataDir + "xDimention.jpg");
}
use of com.aspose.barcode.BarCodeBuilder in project Aspose.BarCode-for-Java by aspose-barcode.
the class CodeTextLocation method main.
public static void main(String[] args) {
// The path to the resource directory.
String dataDir = Utils.getDataDir(CodeTextLocation.class) + "Barcode/BasicFeatures/";
BarCodeBuilder builder = new BarCodeBuilder("GTIN:898978777776665655 " + "UID: 121212121212121212 " + "Batch:GH768 " + "Exp.Date:150923", com.aspose.barcode.EncodeTypes.DATA_MATRIX);
builder.setCodeLocation(CodeLocation.Right);
builder.setMargins(new MarginsF(0, 0, 0, 0));
builder.save(dataDir + "codetextRight.png");
}
use of com.aspose.barcode.BarCodeBuilder in project Aspose.BarCode-for-Java by aspose-barcode.
the class WideNarrowRatio method main.
public static void main(String[] args) {
// The path to the resource directory.
String dataDir = Utils.getDataDir(WideNarrowRatio.class) + "Barcode/AdvancedFeatures/";
// Instantiate barcode object
BarCodeBuilder bb = new BarCodeBuilder();
// Set the code text of the barcode
bb.setCodeText("12345678");
// Set the symbology type to code39
bb.setEncodeType(com.aspose.barcode.EncodeTypes.CODE_39_EXTENDED);
// Set the wide to narrow ratio for the barcode
bb.setWideNarrowRatio(3.0f);
// Save the image to disk in PNG format
bb.save(dataDir + "wideNarrowRatio.png");
}
use of com.aspose.barcode.BarCodeBuilder in project Aspose.BarCode-for-Java by aspose-barcode.
the class SetCodeText method main.
public static void main(String[] args) {
// The path to the resource directory.
String dataDir = Utils.getDataDir(SetCodeText.class) + "Barcode/BasicFeatures/";
// Instantiate BarCodeBuilder object
BarCodeBuilder bb = new BarCodeBuilder();
// Set the code text for the barcode
bb.setCodeText("12345678");
// Set the symbology type to Code128
bb.setEncodeType(com.aspose.barcode.EncodeTypes.CODE_128);
// Set the width of the bars to 0.5 millimeter
bb.setxDimension(0.5f);
// Save the barcode image to file
bb.save(dataDir + "setCodeText.jpg");
}
Aggregations