Aspose.BarCode for Java 17.01 - Release Notes

Aspose.BarCode for Java has been updated to version 17.01 and we are pleased to announce it. The following is a list of changes in this version of Aspose.Java.

Features and Improvements

Key Summary Category
BARCODENET-36423 Reading problem of DataMatrix barcode Enhancement
BARCODENET-36405 Creating barcode of 300 dpi is producing wider barcode image Enhancement
BARCODENET-36352 Implement algorithm for recognizing 3D-distorted MicroQr Enhancement
BARCODENET-34234 BarCodeBuilder does not generate CodeText for characters: “~B” and “~C” properly for PDF417; Enhancement
BARCODENET-33257 Cannot recognize DataMatrix when image has been scanned at 200DPI Enhancement

Usage examples

BARCODENET-36352 Implement algorithm for recognizing 3D-distorted MicroQr

Sample:

 BarCodeReader reader = new BarCodeReader(folder + "SonyDV_BatteryPack_00.JPG", DecodeType.MICRO_QR);

reader.setRecognitionMode(RecognitionMode.MaxQuality);

while(reader.read()

{

   System.out.println(reader.getCodeText());

}

Result:

 FV50CE

BARCODENET-34234 BarCodeBuilder does not generate CodeText for characters: “~B” and “~C” properly for PDF417;

Sample:

 String codeText = "A^aa^a^a^a^someFreeText~B^bb^b^b^b^OtherFreeText~C^cc^c^c^c^LastFreeText|";

BarCodeBuilder b = new BarCodeBuilder();

b.setSymbologyType(Symbology.Pdf417);

b.setAspectRatio(4f);

b.setPdf417ErrorLevel(Pdf417ErrorLevel.Level4);

b.setCodeLocation(CodeLocation.None);

b.setCodeText(codeText);

b.save("Issue34234.SavedFromMemory.jpg", BarCodeImageFormat.Jpeg);

BarCodeReader reader = new BarCodeReader("Issue34234.SavedFromMemory.jpg", BarCodeReadType.Pdf417);

while(reader.read()

{

   System.out.println(reader.getCodeText());

}

Result:

 A^aa^a^a^a^someFreeText~B^bb^b^b^b^OtherFreeText~C^cc^c^c^c^LastFreeText|

Note: To input decimal ascii code try next sample. Sample:

 String expected = "A^aa^a^a^a^someFreeText~B^bb^b^b^b^OtherFreeText~C^cc^c^c^c^LastFreeText|";

BarCodeBuilder builder = new BarCodeBuilder();

builder.setEncodeType(EncodeTypes.PDF_417);

builder.setPdf417ErrorLevel(Pdf417ErrorLevel.Level4);

builder.setCodeLocation(CodeLocation.None);

builder.setColumns(8);

builder.setCodeText(expected);

ByteArrayOutputStream stream = new ByteArrayOutputStream();

builder.save(stream, BarCodeImageFormat.Jpeg);

stream.flush();

BarCodeReader reader = new BarCodeReader(new ByteArrayInputStream(stream.toByteArray()), DecodeType.PDF_417);

while(reader.read()

{

   System.out.println(reader.getCodeText());

}

Result:

 ABC

ABC

BARCODENET-33257 Cannot recognize DataMatrix when image has been scanned at 200DPI

Sample:

 Map<String, String> files = new HashMap<String, String>();

files.put("Barcode200DPIA.png", "ZZZ#WAS#EF#0203##Unknown#Cost Estimate - Conventional#Cost Estimate Sheet#Test#6/19/2012#True#N/A");

files.put("Barcode200DPIB.png", "ZZZ#WAS#EF#0203##Unknown#Summary MSS#Summary MSS#Test#6/19/2012#True#N/A");

for(String filename : files.keySet())

{

   BarCodeReader reader = new BarCodeReader(folder + filename, DecodeType.DATA_MATRIX);

   reader.setRecognitionMode(RecognitionMode.MaxBarCodes);

   while(reader.read()

   {

      System.out.println(reader.getCodeText());

   }

}

Result:

 DataMatrix: ZZZ#WAS#EF#0203##Unknown#Cost Estimate - Conventional#Cost Estimate Sheet#Test#6/19/2012#True#N/A

DataMatrix: ZZZ#WAS#EF#0203##Unknown#Summary MSS#Summary MSS#Test#6/19/2012#True#N/A

BARCODENET-36405 Creating barcode of 300 dpi is producing wider barcode image

Sample:

 BarCodeBuilder builder = new BarCodeBuilder();

builder.setCodeText("6040223579");

builder.setResolution(new Resolution(300, 300, ResolutionMode.Graphics));

builder.setEncodeType(EncodeTypes.CODE_128);

builder.setBarHeight(0.6f);

builder.save("Code128_0.6mm_300pdi.tiff", ImageFormat.getTiff());