Search in sources :

Example 41 with BarCodeBuilder

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

the class ManageXAndYDimension method setYDimension.

public static void setYDimension() {
    // 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.PDF_417);
    // Set the Y-Dimension for the bars of the barcode
    bb.setyDimension(4);
    // Save the Barcode image to file
    bb.save(dataDir + "yDimention.jpg");
}
Also used : BarCodeBuilder(com.aspose.barcode.BarCodeBuilder)

Example 42 with BarCodeBuilder

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

the class SetBarsHeight method main.

public static void main(String[] args) {
    // The path to the resource directory.
    String dataDir = Utils.getDataDir(SetBarsHeight.class) + "Barcode/AdvancedFeatures/";
    // Instantiate barcode object
    BarCodeBuilder bb = new BarCodeBuilder();
    bb.setCodeText("12345678");
    bb.setEncodeType(com.aspose.barcode.EncodeTypes.CODE_128);
    // Set the bar height to be 3 milimeter
    bb.setBarHeight(3.0f);
    // Save the Barcode image to file
    bb.save(dataDir + "barsHeight.jpg");
}
Also used : BarCodeBuilder(com.aspose.barcode.BarCodeBuilder)

Example 43 with BarCodeBuilder

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

the class SetStartAndStopSymbols method main.

public static void main(String[] args) {
    // The path to the resource directory.
    String dataDir = Utils.getDataDir(SetStartAndStopSymbols.class) + "Barcode/AdvancedFeatures/";
    // Create instance of BarCodeBuilder, specify codetext and symbology in the constructor
    BarCodeBuilder builder = new BarCodeBuilder("12345678", com.aspose.barcode.EncodeTypes.CODABAR);
    // Set the codabar start symbol to A
    builder.setCodabarStartSymbol(CodabarSymbol.A);
    // Set the codabar stop symbol to D
    builder.setCodabarStopSymbol(CodabarSymbol.D);
    // Save the image to disk in PNG format
    builder.save(dataDir + "startAndStopSymbols.png");
}
Also used : BarCodeBuilder(com.aspose.barcode.BarCodeBuilder)

Example 44 with BarCodeBuilder

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

the class SupplementData method main.

public static void main(String[] args) {
    // The path to the resource directory.
    String dataDir = Utils.getDataDir(SupplementData.class) + "Barcode/AdvancedFeatures/";
    BarCodeBuilder bb = new BarCodeBuilder();
    bb.setCodeText("123456789123");
    bb.setEncodeType(com.aspose.barcode.EncodeTypes.EAN_13);
    // Set the supplement data (5 Digit)
    bb.setSupplementData("12345");
    // Set space between the supplemental barcode and main barcode
    bb.setSupplementSpace(2.0f);
    // Save the Barcode image to file
    bb.save(dataDir + "supplementData.jpg");
}
Also used : BarCodeBuilder(com.aspose.barcode.BarCodeBuilder)

Example 45 with BarCodeBuilder

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

the class BarcodeCaption method main.

public static void main(String[] args) {
    // The path to the resource directory.
    String dataDir = Utils.getDataDir(BarcodeCaption.class) + "Barcode/BasicFeatures/";
    // Instantiate Barcode object
    BarCodeBuilder bb = new BarCodeBuilder();
    // Set the code text of the barcode
    bb.setCodeText("1234567");
    // Set the symbology type to code128
    bb.setEncodeType(com.aspose.barcode.EncodeTypes.CODE_128);
    Caption caption = new Caption();
    caption.setText("Caption");
    caption.setTextAlign(com.aspose.barcode.StringAlignment.Center);
    bb.setCaptionAbove(caption);
    bb.setCaptionBelow(caption);
    bb.getCaptionAbove().setTextAlign(com.aspose.barcode.StringAlignment.Near);
    bb.getCaptionAbove().setText("Aspose.Demo");
    bb.getCaptionAbove().setVisible(true);
    bb.getCaptionAbove().setFont(new java.awt.Font("Pristina", Font.PLAIN, 14));
    bb.getCaptionAbove().setForeColor(java.awt.Color.RED);
    bb.getCaptionBelow().setTextAlign(com.aspose.barcode.StringAlignment.Far);
    bb.getCaptionBelow().setText("Aspose.Demo");
    bb.getCaptionBelow().setVisible(true);
    bb.getCaptionBelow().setFont(new java.awt.Font("Pristina", Font.PLAIN, 14));
    bb.getCaptionBelow().setForeColor(java.awt.Color.RED);
    // Save the Barcode image to file
    bb.save(dataDir + "barcodeCaption.jpg");
}
Also used : Font(java.awt.Font) BarCodeBuilder(com.aspose.barcode.BarCodeBuilder) Caption(com.aspose.barcode.Caption)

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