ByteScout Barcode Reader SDK - C# - General Example reading barcodes - ByteScout

ByteScout Barcode Reader SDK – C# – General Example reading barcodes

  • Home
  • /
  • Articles
  • /
  • ByteScout Barcode Reader SDK – C# – General Example reading barcodes

general example reading barcodes in C# using ByteScout BarCode Reader SDK

How to code general example reading barcodes in C#: How-To tutorial

Every ByteScout tool contains example C# source codes that you can find here or in the folder with installed ByteScout product. ByteScout BarCode Reader SDK was made to help with general example reading barcodes in C#. ByteScout BarCode Reader SDK is the SDK for reading of barcodes from PDF, images and live camera or video. Almost every common type like Code 39, Code 128, GS1, UPC, QR Code, Datamatrix, PDF417 and many others are supported. Supports noisy and defective images and docs. Includes optional documents splitter and merger for pdf and tiff based on found barcodess. Batch mode is supported for superior performance using multiple threads. Decoded values are easily exported to JSON, CSV, XML and to custom format.

You will save a lot of time on writing and testing code as you may just take the code below and use it in your application. To do general example reading barcodes in your C# project or application you may simply copy & paste the code and then run your app! You can use these C# sample examples in one or many applications.

Trial version can be obtained from our website for free. It includes this and other source code samples for C#.

Try ByteScout BarCode Reader SDK today: Get 60 Day Free Trial or sign up for Web API

Program.cs
      
using System; using System.IO; using Bytescout.BarCodeReader; namespace CommonExample { class Program { const string ImageFile = "Barcode.jpg"; static void Main() { Console.WriteLine("Reading barcode(s) from image {0}", Path.GetFullPath(ImageFile)); Reader reader = new Reader(); reader.RegistrationName = "demo"; reader.RegistrationKey = "demo"; // Set barcode type to find reader.BarcodeTypesToFind.All = true; // We recommend to use specific barcode types to avoid false positives, e.g.: // reader.BarcodeTypesToFind.QRCode = true; // reader.BarcodeTypesToFind.Code39 = true; /* ----------------------------------------------------------------------- NOTE: We can read barcodes from specific page to increase performance. For sample please refer to "Decoding barcodes from PDF by pages" program. ----------------------------------------------------------------------- */ // Read barcodes FoundBarcode[] barcodes = reader.ReadFrom(ImageFile); foreach (FoundBarcode barcode in barcodes) { Console.WriteLine("Found barcode with type '{0}' and value '{1}'", barcode.Type, barcode.Value); } // Cleanup reader.Dispose(); Console.WriteLine("Press any key to exit.."); Console.ReadKey(); } } }

Try ByteScout BarCode Reader SDK today: 60 Day Free Trial (on-premise version) or sign up for Web API (on demand version)

VIDEO

ON-PREMISE VERSION

Get 60 Day Free Trial or Visit ByteScout BarCode Reader SDK page

Explore ByteScout BarCode Reader SDK documentation

WEB API

Sign Up for free Web API key

Explore Web API Documentation

Tutorials:

prev
next