QR code recognition sample

  • Last Post yesterday
Mokhtar NEBLI posted this 1 weeks ago


i'm looking for C# for QR code and BAR code  recognition samples using ABBYY FlexiCapture Engine and ABBYY FlexiLayout Studio

Order By: Standard | Newest | Votes
Nikolay Krivchanskiy posted this 2 days ago

Hi Mokhtar,


If you wish to recognize barcodes, all you have to do is create document definition with barcode fields and apply it to the documents you need to recognize. The recognition will be conducted automatically for all pages that match the document definition. The result of the recognition will be exported correctly, when you decide to export it.


If you do not have a document definition for barcode analysis, you should create such document definition first, for more information on that, please refer to Help → Guided Tour → Advanced Techniques → Creating Document Definitions.


It you wish to recognize barcodes manually from your code, you should iterate through blocks inside of a document, until you find a block with Type parameter set as “BT_Barcode”.


Barcodes can be marked as a field or as a static element. This depends on the barcode meaning in the documents being processed: if it is intended for Document Definition matching or identification, it is created in the static elements mode (anchor barcode). Meanwhile, if a barcode is intended for data capture, it is created in the field marking mode. If you need to access static barcode, please use  “BT_StaticBarcode” to refer to it.




If you have document definition, matching barcodes and you are willing to access them directly from the code, you can achieve that, by iterating through blocks on the page. It can be done like that:


IDocument document = processor.RecognizeNextDocument();

pages = document.Pages;

if (pages != null && pages.Count > 0)



    foreach (IPage page in pages)



        if (page.Blocks != null && page.Blocks.Count > 0)



            foreach (IBlock block in page.Blocks)


                if (block.Type == BlockTypeEnum.BT_Barcode)


                    //Do something with block







Mokhtar NEBLI posted this yesterday


How can i get value from block ?