Search in sources :

Example 16 with BarCodeBuilder

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();
}
Also used : BarCodeBuilder(com.aspose.barcode.BarCodeBuilder)

Example 17 with BarCodeBuilder

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");
}
Also used : BarCodeBuilder(com.aspose.barcode.BarCodeBuilder)

Example 18 with BarCodeBuilder

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");
}
Also used : BarCodeBuilder(com.aspose.barcode.BarCodeBuilder) MarginsF(com.aspose.barcode.MarginsF)

Example 19 with BarCodeBuilder

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");
}
Also used : BarCodeBuilder(com.aspose.barcode.BarCodeBuilder)

Example 20 with BarCodeBuilder

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