Our Goal is to read Bar Codes from Drivers Licenses. All images will be coming from a URL and I convert them to a stream. BUT reader always return a null. is there something wrong with my code?
my code looks like this:
var webClient = new WebClient();
byte[] imageBytes = webClient.DownloadData(urladdress);
Stream stream = new MemoryStream(imageBytes);
Aspose.BarCode.License license = new Aspose.BarCode.License();
license.SetLicense(“Aspose.BarCode.lic”);
streambytes = stream.Length.ToString();
try
{
BarCodeReader reader = new BarCodeReader();
reader.RecognitionMode = RecognitionMode.MaxBarCodes;
reader = new BarCodeReader(stream);
while (reader.Read())
{
barcodetype = reader.GetCodeType().ToString();
barcodecontents = reader.GetCodeText().ToString();
barcodesdetected += 1;
}
reader.Close();
}
catch (Aspose.BarCode.BarCodeException ex)
{
ErrorCode = ex.Message;
}