VintaSoft Barcode .NET SDK Discussions

Questions, comments and suggestions concerning VintaSoft Barcode .NET SDK.

Board index < VintaSoft Barcode < VintaSoft Barcode .NET SDK Discussions

We are migrating to new forums engine, no new registration or posting currently available. TIA for your patience.

Reading GS1 Info1D



Reading GS1 Info1D

Post by tiagolpt »

Hello guys,

i've been using the software to read barcode from given images,

when using reader demo program i've been able to see information about the narrow bar count and narrow bar size..

to acess this info in code im doing the follow:
IBarcodeInfo[] infos = reader.ReadBarcodes(barcodeImage);
for (int i = 0; i < infos.Length; i++)
{
    IBarcodeInfo info = infos[i];
    var info1d = info as BarcodeInfo1D;
}
if i use a GS1-128 the cast returns null, however I can see on the private properties of that object that in fact it contains those two properties (narrow bar count and narrow bar size), the strange thing is, if i remove the subset of GS1-128 from the settings the cast works..

How can i access those two properties without the cast?

In the reader demo those properties are always available.


Re: Reading GS1 Info1D

Post by Alex »

Hello,

Please use the "info.GetType()" method for getting information about instance type and cast the instance to the correct type.

Best regards, Alexander


Re: Reading GS1 Info1D

Post by DarkStar »

Hello!

Use this code:
IBarcodeInfo[] infos = reader.ReadBarcodes(barcodeImage);
for (int i = 0; i < infos.Length; i++)
{
    IBarcodeInfo info = infos[i];
    if (info is BarcodeSubsetInfo)
       info = ((BarcodeSubsetInfo)info).BaseBarcodeInfo;
    var info1d = info as BarcodeInfo1D;
    ...
}


Page 1 from 1: 1