Search in sources :

Example 6 with BarCodeBuilder

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

the class CreatingAQRBarcode method createAQRBarcode.

public static void createAQRBarcode(String dataDir) throws IOException {
    BarCodeBuilder b = new BarCodeBuilder();
    b.setEncodeType(com.aspose.barcode.EncodeTypes.QR);
    b.setCodeText("1234567890");
    b.save(dataDir + "QRBarcode.bmp", BarCodeImageFormat.Bmp);
}
Also used : BarCodeBuilder(com.aspose.barcode.BarCodeBuilder)

Example 7 with BarCodeBuilder

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

the class CreatingAQRBarcode method errorCorrection.

public static void errorCorrection(String dataDir) throws IOException {
    BarCodeBuilder b = new BarCodeBuilder();
    b.setEncodeType(com.aspose.barcode.EncodeTypes.QR);
    b.setQRErrorLevel(QRErrorLevel.LevelH);
    b.setCodeText("1234567890");
    b.save(dataDir + "errorCorrectionQRBarcode.bmp", BarCodeImageFormat.Bmp);
}
Also used : BarCodeBuilder(com.aspose.barcode.BarCodeBuilder)

Example 8 with BarCodeBuilder

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

the class CreatingAnAztecBarcode method createAnAztecBarcode.

public static void createAnAztecBarcode(String dataDir) throws IOException {
    BarCodeBuilder b = new BarCodeBuilder();
    b.setEncodeType(com.aspose.barcode.EncodeTypes.AZTEC);
    b.setCodeText("1234567890");
    b.save(dataDir + "aztec.bmp", BarCodeImageFormat.Bmp);
}
Also used : BarCodeBuilder(com.aspose.barcode.BarCodeBuilder)

Example 9 with BarCodeBuilder

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

the class CreatingTwoDimensional2DBarcode method creatingAPdf417Barcode.

public static void creatingAPdf417Barcode(String dataDir) {
    BarCodeBuilder b = new BarCodeBuilder();
    b.setEncodeType(com.aspose.barcode.EncodeTypes.PDF_417);
    // Width of each module
    b.setxDimension(0.6f);
    // Height of each module
    b.setyDimension(1.2f);
    b.setCodeText("this is some test code text. \n Second line \n third line.");
    b.save(dataDir + "pdf417.bmp");
}
Also used : BarCodeBuilder(com.aspose.barcode.BarCodeBuilder)

Example 10 with BarCodeBuilder

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

the class DetectTheUnicodeEncoding method main.

public static void main(String[] args) throws Exception {
    ApplyALicense.applyALicense();
    // The path to the resource directory.
    String dataDir = Utils.getDataDir(DetectTheUnicodeEncoding.class) + "2DBarcode/BasicFeatures/";
    String imageFilePath = dataDir + "unicodeEncoding.png";
    BarCodeBuilder builder = new BarCodeBuilder();
    builder.setCodeText("Слово");
    builder.setEncodeType(com.aspose.barcode.EncodeTypes.QR);
    builder.setCodeTextEncoding(StandardCharsets.UTF_8);
    builder.save(imageFilePath, BarCodeImageFormat.Png);
    BarCodeReader reader = new BarCodeReader(imageFilePath, com.aspose.barcode.barcoderecognition.DecodeType.QR);
    reader.setDetectEncoding(true);
    if (reader.read()) {
        // "Слово"
        System.out.println(reader.getCodeText());
    }
}
Also used : BarCodeBuilder(com.aspose.barcode.BarCodeBuilder) BarCodeReader(com.aspose.barcode.barcoderecognition.BarCodeReader)

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