File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919 {
2020 "Name" : " task-oned-retail" ,
2121 "ExpectedBarcodesCount" : 0 ,
22- "BarcodeFormatIds" : [
23- " BF_EAN_13" , " BF_EAN_8" , " BF_UPC_A" , " BF_UPC_E"
24- ],
22+ "BarcodeFormatIds" : [
23+ " BF_EAN_13" ,
24+ " BF_EAN_8" ,
25+ " BF_UPC_A" ,
26+ " BF_UPC_E" ,
27+ " BF_GS1_DATABAR"
28+ ],
2529 "SectionArray" : [
2630 {
2731 "Section" : " ST_REGION_PREDETECTION" ,
Original file line number Diff line number Diff line change @@ -76,17 +76,25 @@ static void Main(string[] args)
7676 else if ( result . GetErrorCode ( ) != ( int ) EnumErrorCode . EC_OK )
7777 Console . WriteLine ( "Error: " + result . GetErrorCode ( ) + "," + result . GetErrorString ( ) ) ;
7878
79+ FileImageTag tag = result . GetOriginalImageTag ( ) as FileImageTag ;
80+ int pageNumber = tag != null ? tag . GetPageNumber ( ) : index ;
81+
7982 // 6. Output the barcode text.
8083 DecodedBarcodesResult barcodeResult = result . GetDecodedBarcodesResult ( ) ;
8184 if ( barcodeResult == null || barcodeResult . GetItems ( ) . Length == 0 )
82- Console . WriteLine ( "Page-" + ( index + 1 ) + " No barcode detected." ) ;
83- BarcodeResultItem [ ] items = barcodeResult . GetItems ( ) ;
84- Console . WriteLine ( "Page-" + ( index + 1 ) + " Decoded " + items . Length + " barcodes." ) ;
85- for ( int i = 0 ; i < items . Length ; i ++ )
8685 {
87- Console . WriteLine ( "Result " + ( i + 1 ) ) ;
88- Console . WriteLine ( "Barcode Format: " + items [ i ] . GetFormatString ( ) ) ;
89- Console . WriteLine ( "Barcode Text: " + items [ i ] . GetText ( ) ) ;
86+ Console . WriteLine ( "Page-" + ( pageNumber + 1 ) + " No barcode detected." ) ;
87+ }
88+ else
89+ {
90+ BarcodeResultItem [ ] items = barcodeResult . GetItems ( ) ;
91+ Console . WriteLine ( "Page-" + ( pageNumber + 1 ) + " Decoded " + items . Length + " barcodes." ) ;
92+ for ( int i = 0 ; i < items . Length ; i ++ )
93+ {
94+ Console . WriteLine ( "Result " + ( i + 1 ) ) ;
95+ Console . WriteLine ( "Barcode Format: " + items [ i ] . GetFormatString ( ) ) ;
96+ Console . WriteLine ( "Barcode Text: " + items [ i ] . GetText ( ) ) ;
97+ }
9098 }
9199 }
92100 }
Original file line number Diff line number Diff line change @@ -47,15 +47,19 @@ static void Main(string[] args)
4747 {
4848 Console . WriteLine ( "Error: " + result . GetErrorCode ( ) + ", " + result . GetErrorString ( ) ) ;
4949 }
50+
51+ FileImageTag tag = result . GetOriginalImageTag ( ) as FileImageTag ;
52+ int pageNumber = tag != null ? tag . GetPageNumber ( ) : index ;
53+
5054 DecodedBarcodesResult barcodesResult = result . GetDecodedBarcodesResult ( ) ;
5155 BarcodeResultItem [ ] items = barcodesResult != null ? barcodesResult . GetItems ( ) : null ;
5256 if ( items == null || items . Length == 0 )
5357 {
54- Console . WriteLine ( "Page-" + ( index + 1 ) + " No barcode detected." ) ;
58+ Console . WriteLine ( "Page-" + ( pageNumber + 1 ) + " No barcode detected." ) ;
5559 }
5660 else
5761 {
58- Console . WriteLine ( "Page-" + ( index + 1 ) + " Decoded " + items . Length + " barcodes" ) ;
62+ Console . WriteLine ( "Page-" + ( pageNumber + 1 ) + " Decoded " + items . Length + " barcodes" ) ;
5963 for ( int i = 0 ; i < items . Length ; i ++ )
6064 {
6165 BarcodeResultItem barcodeResultItem = items [ i ] ;
Original file line number Diff line number Diff line change @@ -243,16 +243,19 @@ internal static void Main(string[] args)
243243 else if ( result . GetErrorCode ( ) != ( int ) EnumErrorCode . EC_OK )
244244 Console . WriteLine ( "Error: " + result . GetErrorCode ( ) + ", " + result . GetErrorString ( ) ) ;
245245
246+ FileImageTag tag = result . GetOriginalImageTag ( ) as FileImageTag ;
247+ int pageNumber = tag != null ? tag . GetPageNumber ( ) : index ;
248+
246249 // 5. Output the barcode format and barcode text.
247250 DecodedBarcodesResult barcodeResult = result . GetDecodedBarcodesResult ( ) ;
248251 BarcodeResultItem [ ] items = barcodeResult != null ? barcodeResult . GetItems ( ) : null ;
249252 if ( items == null || items . Length == 0 )
250253 {
251- Console . WriteLine ( "Page-" + ( index + 1 ) + " No barcode found." ) ;
254+ Console . WriteLine ( "Page-" + ( pageNumber + 1 ) + " No barcode found." ) ;
252255 }
253256 else
254257 {
255- Console . WriteLine ( "Page-" + ( index + 1 ) + " Decoded " + items . Length + " barcodes." ) ;
258+ Console . WriteLine ( "Page-" + ( pageNumber + 1 ) + " Decoded " + items . Length + " barcodes." ) ;
256259 for ( int i = 0 ; i < items . Length ; i ++ )
257260 {
258261 Console . WriteLine ( "Result " + ( i + 1 ) ) ;
Original file line number Diff line number Diff line change @@ -52,16 +52,19 @@ static void Main(string[] args)
5252 else if ( result . GetErrorCode ( ) != ( int ) EnumErrorCode . EC_OK )
5353 Console . WriteLine ( "Error: " + result . GetErrorCode ( ) + "," + result . GetErrorString ( ) ) ;
5454
55+ FileImageTag tag = result . GetOriginalImageTag ( ) as FileImageTag ;
56+ int pageNumber = tag != null ? tag . GetPageNumber ( ) : index ;
57+
5558 // 5. Output the barcode format and barcode text.
5659 DecodedBarcodesResult barcodeResult = result . GetDecodedBarcodesResult ( ) ;
5760 BarcodeResultItem [ ] items = barcodeResult != null ? barcodeResult . GetItems ( ) : null ;
5861 if ( items == null || items . Length == 0 )
5962 {
60- Console . WriteLine ( "Page-" + ( index + 1 ) + " No barcode found." ) ;
63+ Console . WriteLine ( "Page-" + ( pageNumber + 1 ) + " No barcode found." ) ;
6164 }
6265 else
6366 {
64- Console . WriteLine ( "Page-" + ( index + 1 ) + " Decoded " + items . Length + " barcodes." ) ;
67+ Console . WriteLine ( "Page-" + ( pageNumber + 1 ) + " Decoded " + items . Length + " barcodes." ) ;
6568 for ( int i = 0 ; i < items . Length ; i ++ )
6669 {
6770 Console . WriteLine ( "Result " + ( i + 1 ) ) ;
You can’t perform that action at this time.
0 commit comments