Source code documentation samples provide quick and easy way to add a required functionality into your application. 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. It can be used to decode page by page from PDF using C#.
This code snippet below for ByteScout BarCode Reader SDK works best when you need to quickly decode page by page from PDF in your C# application. In order to implement the functionality, you should copy and paste this code for C# below into your code editor with your app, compile and run your application. Enjoy writing a code with ready-to-use sample codes in C#.
ByteScout free trial version is available for download from our website. It includes all these programming tutorials along with 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)
using System; using Bytescout.BarCodeReader; namespace BarcodesFromPDF { class Program { static void Main() { Reader reader = new Reader(); reader.RegistrationName = "demo"; reader.RegistrationKey = "demo"; // Limit search to 1-dimensional barcodes only (exclude 2D barcodes to speed up the processing). // Change to barcodeReader.BarcodeTypesToFind.SetAll() to scan for all supported 1D and 2D barcode types // or select specific type, e.g. barcodeReader.BarcodeTypesToFind.PDF417 = True reader.BarcodeTypesToFind.All1D = true; // Input filename string fileName = "example.pdf"; // Pages from which barcodes to be fetched int[] readFromPages = { 1, 2 }; foreach (var pageNo in readFromPages) { Console.WriteLine("\n\nReading barcodes from PDF page {0}...", pageNo); // Decoding barcodes from PDF on page-by-page basis instead of reading whole page FoundBarcode[] barcodes = reader.ReadFrom(fileName, (pageNo - 1)); // Found results foreach (FoundBarcode barcode in barcodes) { Console.WriteLine("Found Barcode, Type: '{0}', Value: '{1}', Position: {2}", barcode.Type, barcode.Value, barcode.Rect); } } // Cleanup reader.Dispose(); Console.WriteLine(); Console.WriteLine("Press any key to continue."); Console.ReadKey(); } } }
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
Get Your API Key
Explore Web API Docs
Explore Web API Samples
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
Get Your API Key
Explore Web API Docs
Explore Web API Samples
also available as: