C# Barcode Reader Library
How to C#: Quick to Start Using XImage.Barcode Reader


How to C#: Quick to Start Using XImage.Barcode Reader






As a leading professional third-party SDK supplier in the field of image and document management, RasterEdge has always been devoted to providing various effective and fully-functional imaging solutions for developers who are working on different .NET developing applications.


Related .net document control helps:
asp.net edit pdf page: ASP.NET PDF Pages Edit Control: add, remove, sort, replace PDF pages online using C#
document viewer asp.net c#: ASP.NET Document Viewer using C#: Open, View, Annotate, Redact, Convert document files in ASP.NET using C#, HTML5, JQuer...
asp.net edit pdf text color: ASP.NET PDF Text Edit Control: online edit PDF text content using C# ASP.NET
asp.net annotate pdf control: ASP.NET Annotate PDF Control: annotate, comment, markup PDF document online using ASP.NET C#
asp.net tiff viewer control: ASP.NET Tiff Viewer: view, annotate multipage Tiff images in ASP.NET MVC, WebForms using C# Control
asp.net open word document in browser: ASP.NET Office Word Document Viewer: view Word doc files online using C# in ASP.NET MVC web applications
asp.net excel view: ASP.NET Excel Viewer in C# Control (MVC & WebForms): view Office Excel document in web browser.


This C#.NET barcode reading toolkit, RasterEdge XImage.Barcode Reader SDK for .NET is one of the most strongly-featured and mature document imaging library toolkits on the market, which is designed to help developers implement barcode-related tasks in their C#.NET applications.


Using this C#.NET barcode reading control, you can easily and quickly complete both 1d and 2d barcode scanning from images. tiff files, PDF documents, Word documents, Excel files and PPT files in any type of a 32-bit or 64-bit .NET application, including ASP.NET web service and Windows Forms for any .NET Framework version from 2.0 to 4.5.


As you know, there're various reliable barcode reading features that can be implemented in C#.NET programming. And you may want to have a quick testing on RasterEdge XImage.Barcode Reader after downloading its free trial package online.  To meet your requirement, on this quick to start page, we will tell how to create a C# console application, and read EAN-13 from PDF in C#.NET.




Create a C# Console Application



Open Visual Studio and click "New" from toolbar. Note, Visual Studio 2005 and above versions are available;


Choose "C# Language" and "Console Application" respectively to create a project.




Sample C# Code for Reading EAN-13 from PDF



By following steps below, your C# project are able to read EAN-13 from PDF document.


Choose "C# Language" and "Console Application" respectively to create a project.


  RasterEdge.Imaging.Basic.dll


  RasterEdge.Imaging.Basic.Codec.dll


  RasterEdge.Imaging.Processing.dll


  RasterEdge.Imaging.Font.dll


  RasterEdge.Imaging.Drawing.dll


  RasterEdge.XImage.BarcodeScanner.dll


  RasterEdge.XImage.Raster.Core.dll


  RasterEdge.XImage.Raster.dll


  RasterEdge.XDoc.PDF.dll


Use corresponding namespaces;


  using RasterEdge.XImage.BarcodeScanner;


  using RasterEdge.Imaging.Basic;


  using RasterEdge.XDoc.PDF;


Note: When you get the error "Could not load file or assembly 'RasterEdge.Imaging.Basic' or any other assembly or one of its dependencies. An attempt to load a program with an incorrect format", please check your configure as follows:

       

       If you are using x64 libraries/dlls, Right click the project -> Properties -> Build -> Platform target: x64.

       

       If using x86, the platform target should be x86.



Copy of the following C# sample code to your application.




            // load PDF document
            PDFDocument doc = new PDFDocument(inputDirectory + "Sample_Barcode.pdf");

            // get the page you want to scan
            BasePage page = doc.GetPage(0);

            // set reader setting
            ReaderSettings setting = new ReaderSettings();

            // set type to read
            setting.AddTypesToRead(BarcodeType.EAN13);

            // read barcode from PDF page
            Barcode[] barcodes = BarcodeReader.ReadBarcodes(setting, page);

            foreach (Barcode barcode in barcodes)
            {
                // print the loaction of barcode on image
                Console.WriteLine(barcode.BoundingRectangle.X + "  " + barcode.BoundingRectangle.Y);

                // output barcode data onto screen 
                Console.WriteLine(barcode.DataString);
            }