ByteScout Barcode Reader SDK - C# - Set Barcode Decoding Profiles - ByteScout

ByteScout Barcode Reader SDK – C# – Set Barcode Decoding Profiles

  • Home
  • /
  • Articles
  • /
  • ByteScout Barcode Reader SDK – C# – Set Barcode Decoding Profiles

How to set barcode decoding profiles in C# using ByteScout BarCode Reader SDK

The tutorial shows how to set barcode decoding profiles in C#

Learn how to set barcode decoding profiles in C# with this source code sample. ByteScout BarCode Reader SDK is the barcode decoder with support for code 39, code 128, QR Code, Datamatrix, GS1, PDF417 and all other popular barcodes. Can read barcodes from images, pdf, tiff documents and live web camera. Supports noisy and damaged documents, can split and merge pdf and tiff documents based on barcodes. Can export barcode decoder results to XML, JSON, CSV and into custom data structures. It can set barcode decoding profiles in C#.

The SDK samples like this one below explain how to quickly make your application do set barcode decoding profiles in C# with the help of ByteScout BarCode Reader SDK. This C# sample code is all you need for your app. Just copy and paste the code, add references (if needs to) and you are all set! Further enhancement of the code will make it more vigorous.

Our website provides trial version of ByteScout BarCode Reader SDK for free. It also includes documentation and source code samples.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

Program.cs
      
using System; using Bytescout.BarCodeReader; namespace Profiles { /// <summary> /// This example demonstrates the use of profiles. Profiles are set of properties /// allowing to apply them to Reader in any combination quickly. You can use /// predefined profiles or create you own in JSON format like in this example. /// </summary> class Program { static void Main(string[] args) { // Create Bytescout.BarCodeReader.Reader instance using (Reader reader = new Reader()) { reader.RegistrationName = "demo"; reader.RegistrationKey = "demo"; // Apply predefined profiles: // enable Code39; // enable EAN-13; // render PDF at 150 DPI resoultion. reader.Profiles = "code39, ean13, pdf150dpi"; /* ----------------------------------------------------------------------- NOTE: We can read barcodes from specific page to increase performance. For sample please refer to "Decoding barcodes from PDF by pages" program. ----------------------------------------------------------------------- */ // Decode and show barcodes from sample1.pdf reader.ReadFrom("sample1.pdf"); foreach (FoundBarcode foundBarcode in reader.FoundBarcodes) Console.WriteLine("Found \"{0}\" barcode with value \"{1}\"", foundBarcode.Type, foundBarcode.Value); } using (Reader reader = new Reader()) { reader.RegistrationName = "demo"; reader.RegistrationKey = "demo"; // Load and apply custom profiles reader.LoadProfiles("profiles.json"); reader.Profiles = "negative-distorted-datamatrix"; // Decode and show barcodes from sample2.png reader.ReadFrom("sample2.png"); foreach (FoundBarcode foundBarcode in reader.FoundBarcodes) Console.WriteLine("Found \"{0}\" barcode with value \"{1}\"", foundBarcode.Type, foundBarcode.Value); } Console.WriteLine("Press any key to exit..."); Console.ReadKey(); } } }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout BarCode Reader SDK Home Page

Explore ByteScout BarCode Reader SDK Documentation

Explore Samples

Sign Up for ByteScout BarCode Reader SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout BarCode Reader SDK Home Page

Explore ByteScout BarCode Reader SDK Documentation

Explore Samples

Sign Up for ByteScout BarCode Reader SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next