C#: Online Guide
How To: Barcode Reader
ISBN
ISBN
  |  
Home ›› XImage.Barcode Reader ›› C# Barcode Reader: ISBN

C# Imaging - Scan ISBN Barcode in C#.NET


How to Read ISBN Barcode from Images & Documents Using C#. Support Read barcode from PDF in C#.




ISBN Reading Library for C#.NET Imaging



RasterEdge DocImage SDK for .NET contains fully-featured libraries to view, process, manipulate and annotate various image files and document files in C#.NET class applications. The barcode reader add-on from this strong .NET imaging SDK owns fast & high-quality ISBN barcode detecting & reading functions, which can be used to track images, pictures and documents in the daily life.


Related .net document control helps:
asp.net sharepoint document viewer free: ASP.NET SharePoint Document Viewer: view, annotate, redact documents in SharePoint
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 view text file: ASP.NET Text file viewer in MVC, WebForms: Open, view, annotate, convert txt files in C# ASP.NET
asp.net pdf viewer control free: ASP.NET PDF Viewer Control: view, navigate, zoom Adobe PDF document in C# ASP.NET
mvc document viewer: ASP.NET MVC Document Viewer: view, annotate, redact files on ASP.NET MVC web projects
powerpoint viewer asp.net mvc: ASP.NET PowerPoint Document Viewer Control (MVC & WebForms): view ppt, pptx files online in C# using ASP.NET
asp.net document viewer free: EdgeDoc:ASP.NET Document Viewer C# Control: Open, view, annotate, redact, convert documents online in C#, VB.NET, AS...


Designed specifically for .NET developing platform, this barcode reading & decoding library can be seamlessly integrated into C#.NET Windows Forms and ASP.NET web applications for ISBN barcode recognition from documents (PDF, Word, Excel and PowerPoint) and image objects (PNG, TIFF, GIF, BMP, JBIG2 & JPEG).


This C#.NET barcode reader control toolkit can not only decode & detect ISBN barcode (a linear barcode type, used as a unique numeric commercial book identifier) from document image files, but also be used to recognize other 1d and 2d barcode types in C#.NET imaging applications, including Data Matrix, QR Code, EAN-13, Code 128 and UPC-A. Besides, here we recommend you two practical barcode reading applications. One is how to read barcode from scanned PDF document using C# code. The other is how to decode barcode from scanned Word page in C#.NET class application.




C# Imaging ISBN Barcode Reading Features



.NET-oriented compact library, compatible with C# programming language


Add ISBN barcode reading functionality to PDF, Word, Excel & PPT documents processing projects


Decode one or more ISBN barcodes from raster image files & .NET image objects using C#


Enhance ISBN barcode reading rate by reducing non-barcode scanning time using C#.NET


Detect ISBN barcode from target file and decode ISBN barcode value as text using C# code


Decode checksum digit of ISBN barcode from document image file automatically using C#


Offer sample C# code for ISBN barcode recognition from image & document respectively




Steps to Read/Scan Data Matrix from Image/PDF/TIFF/Office File



Load an image or a document(PDF, TIFF, Word, Excel, PowerPoint).


Get a Bitmap or BasePage used to decode or read barcode.


Set the barcode reader settings.


Call the following static method in BarcodeReader.cs to read or scan barcode from Bitmap or BasePage.


  public static Barcode[] ReadBarcodes(ReaderSettings settings, BasePage page)


  public static Barcode[] ReadBarcodes(ReaderSettings settings, Bitmap image)


The barcode information will be saved in the array of Barcode object. While, if you read barcodes information from the BasePage failed, you can try as follows:


  Convert BasePage to Bitmap with higher resolution by Calling method ConvertToImage(int resolution) in the BasePage.cs:



            //Convert page to bitmap.
            //The default resolution is 96, if youo set the resolution higher, it will be better to read or scan barcode.
            Bitmap bmp = page.ConvertToImage(192);

            //  read all barcodes in the page
            Barcode[] barcodes = BarcodeReader.ReadBarcodes(settings, bmp);

            foreach (Barcode barcode in barcodes)
            {
                Console.WriteLine("Data: " + barcode.DataString);
            }



If you want to have a try, please refer to the following demo codes.


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.




Read ISBN Barcode from Image in C#



If you want to scan & read ISBN barcode from image, picture or photo that is stored in one of following image file formats (JPEG, GIF, TIFF, PNG & BMP) using C#.NET, this .NET barcode reader control toolkit is a great choice. Using following C# code, you can detect all ISBN barcodes from png image files and extract ISBN barcode values as data strings. What should be noted here is that this C#.NET barcode reader trial version will decode the first character of ISBN barcode from image files randomly.


Add necessary references to your C#.NET project. Right-click the project and select "Add Reference..." to locate and add the following DLLs as project references;


  RasterEdge.Imaging.Basic.dll


  RasterEdge.XImage.BarcodeScanner.dll


Use corresponding namespaces;


  using RasterEdge.XImage.BarcodeScanner;




            Bitmap bmp = new Bitmap(inputDirectory + "Sample_Barcode.png");
            //  config reader setting
            ReaderSettings settings = new ReaderSettings();
            //  define the type of barcode to scan
            settings.AddTypesToRead(BarcodeType.ISBN);

            //  read all barcodes in the document
            Barcode[] barcodes = BarcodeReader.ReadBarcodes(settings, bmp);

            foreach (Barcode barcode in barcodes)
            {
                Console.WriteLine("Data: " + barcode.DataString);
            }





C#: DLLs for ISBN Scanning from Document(TIFF, PDF, Office)



In order to run the following demo codes reading ISBN from document, the steps as follows are necessary.


Add references:


  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


Use corresponding namespaces;


  using RasterEdge.XImage.BarcodeScanner;


  using RasterEdge.Imaging.Basic;




Decode ISBN from TIFF Image File in C#



Following C# sample code allows users to read ISBN barcode from TIFF image with RasterEdge .NET Barcode Reader.


Add references(Extra):


  RasterEdge.XDoc.TIFF.dll


Use corresponding namespaces(Extra):


  using RasterEdge.XDoc.TIFF;




            // load TIFF document
            TIFFDocument doc = new TIFFDocument(inputDirectory + "Sample_Barcode.tif");

            // 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.ISBN);

            // read barcode from tiff 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);
            }





Recognize ISBN Barcode from PDF Using C#.NET



ISBN barcode reading from PDF document is similar to ISBN barcode decoding from image file. With the application of X & Y location, you can decode all ISBN barcodes from a whole PDF page or from any specified scanning area using C# code. By default, this barcode reader will detect ISBN barcode from a whole page.


Add references(Extra):


  RasterEdge.XDoc.PDF.dll


Use corresponding namespaces(Extra):


  using RasterEdge.XDoc.PDF;




            // 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.ISBN);

            // 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);
            }





Scan ISBN Barcode from Word Using C# Code



This C#.NET ISBN barcode reader & decoder control is also applicable to Word document processing applications. Free C#.NET code below gives an example of scanning ISBN barcode from the Microsoft Word document.


Add references(Extra):


  RasterEdge.XDoc.Word.dll


  RasterEdge.XDoc.Office.Inner.Common.dll


  RasterEdge.XDoc.Office.Inner.Office03.dll


Use corresponding namespaces(Extra):


  using RasterEdge.XDoc.Word;




            // load Word document
            DOCXDocument doc = new DOCXDocument(inputDirectory + "Sample_Barcode.docx");

            // 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.ISBN);

            // read barcode from Word 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);
            }





Use C# Code to Read ISBN Barcode from Excel



With the following C#.NET sample code, you can easily detect and read ISBN barcode from Excel document page.


Add references(Extra):


  RasterEdge.XDoc.Excel.dll


  RasterEdge.XDoc.Office.Inner.Common.dll


  RasterEdge.XDoc.Office.Inner.Office03.dll


Use corresponding namespaces(Extra):


  using RasterEdge.XDoc.Excel;




            // load Excel document
            XLSXDocument doc = new XLSXDocument(inputDirectory + "Sample_Barcode.xlsx");

            // 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.ISBN);

            // read barcode from Excel 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);
            }





Scan ISBN Barcode from PowerPoint Slide in C#



If you want to use our C#.NET ISBN Barcode Reading Control to scan barcode from PowerPoint slide, you can copy demo code below to your project.


Add references(Extra):


  RasterEdge.XDoc.PowerPoint.dll


  RasterEdge.XDoc.Office.Inner.Common.dll


  RasterEdge.XDoc.Office.Inner.Office03.dll


Use corresponding namespaces(Extra):


  using RasterEdge.XDoc.PowerPoint;




            // load PowerPoint document
            PPTXDocument doc = new PPTXDocument(inputDirectory + "Sample_Barcode.pptx");

            // 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.ISBN);

            // read barcode from PowerPoint 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);
            }