Zebra TC75 Scanner problem - Scanning Aztec containing a "raw" byte array

I am developing an application for TC75 which involve scanning (with the built in 2D area imager) an Aztek image. The application is based on Xamarin. Therefore I am using “EMDK for Xamarin 2.0” (http://techdocs.zebra.com/emdk-for-xamarin/2-0/guide/about/). I am initializing the scanner according to the sample code here: http://techdocs.zebra.com/emdk-for-xamarin/2-0/tutorial/barcodeapitutorial/

I have set up the scanner configuration according to this code snippet (C#):

ScannerConfig config = scanner.GetConfig();

config.SkipOnUnsupported = ScannerConfig.SkipOnUnSupported.None;

config.ScanParams.DecodeLEDFeedback = true;

config.ReaderParams.ReaderSpecific.ImagerSpecific.PickList = ScannerConfig.PickList.Enabled;

config.DecoderParams.Aztec.Enabled = true;

scanner.SetConfig(config);

I can scan the Aztek and I receive an string representing the Aztek. So far so good!

Here is the problem. The Aztek contains a binary format. In other words, the Aztek contains a “raw” byte array. If it helps here is how the Aztek is generated (in C#) (The class Barcode is comming from a NuGet package called ”Bytescout.BarCode”):

public static Bitmap EncodeAztecWithBytescoutUsingRawBytes(string base64, int size, bool useCompression = true)

{

var bytes = Base64Url.Decode(base64);

if (useCompression)

{

bytes = Compress(bytes);

}

// Create Barcode component instance

using (var barcode = new Barcode())

{

barcode.RegistrationName = "demo";

barcode.RegistrationKey = "demo";

barcode.Symbology = SymbologyType.Aztec;

// Force binary mode

barcode.Options.AztecCompactionMode = AztecCompactionMode.Binary;

barcode.ResolutionX = size;

barcode.ResolutionY = size;

// Level 2 error correction. 23% of data region will be filled by error correction data

barcode.Options.AztecErrorCorrectionLevel = AztecErrorCorrectionLevel.Level2;

using (var ms = new MemoryStream(bytes))

{

barcode.LoadValueFromStream(ms);

}

var image = barcode.GetImage();

var bitmap = CropToSquare(image);

return bitmap;

}

        }

I have tried to recreate the byte array used in creating the Aztec bitmap but I have not been successfull. It seems like the scanner i not returning the raw data used to create the Aztek i.e. the "bytes" array in the code above is not the same after scan. Any ideas?

Anonymous (not verified)
Have you tried creating the

Have you tried creating the barcode without using compression?  bytes = Compress(bytes);

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Magnus Balldin
Yes, I have. But, with no

Yes, I have. But, with no luck.

The thing is that we are trying to squeeze a lot of data into the Aztec. According to the specification that we are trying to follow the Aztek should contain binary (and compressed) data.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments