I actually took that example and changed the line
com.BarCodeReader reader = new BarCodeReader(_bufferedImage, BarCodeReadType.Datamatrix);
to
com.aspose.barcoderecognition.BarCodeReader reader = new com.aspose.barcoderecognition.BarCodeReader(_bufferedImage, BarCodeReadType.Code39Standard);
On version 2.7.0, this is working. On 4.4.0 (making the appropriate change from BarCodeReadType.Code39Standard to BarCodeReadType.getCode39Standard()), this does not work. Here is my full code:
public static void main(String[] args)
{
String fileName = "C:/test/Unreadable.tif";
try
{
Iterator readers = javax.imageio.ImageIO.getImageReadersBySuffix("tiff");
if (readers.hasNext()) {
File fi = new File(fileName);
ImageInputStream iis = javax.imageio.ImageIO.createImageInputStream(fi);
TIFFDecodeParam param = null;
ImageDecoder dec = ImageCodec.createImageDecoder("tiff", fi, param);
//Get the page count of the tiff image
int pageCount = dec.getNumPages();
ImageReader _imageReader = (ImageReader) (readers.next());
if (_imageReader != null) {
_imageReader.setInput(iis, true);
//Feed each page to the BarCodeReader
for (int i = 0; i < pageCount; i++) {
BufferedImage _bufferedImage = _imageReader.read(i);
com.aspose.barcoderecognition.BarCodeReader reader = new com.aspose.barcoderecognition.BarCodeReader(_bufferedImage, BarCodeReadType.Code39Standard);
//Read the barcodes in a single page
while (reader.read())
{
System.out.println(reader.getCodeText());
}
}
}
}
}
catch (Throwable e)
{
e.printStackTrace();
}
}