Scanning Barcode

Scanning Barcode in C#

GroupDocs.Parser (which is a part of Conholdate.Total for .NET) allows to scan barcode from PDF, Word (DOC, DOCX), PowerPoint (PPT, PPTX), LibreOffice formats and many others.

The Parser API is easy to use and powerful to scan barcodes. The API is capable to read even damaged barcodes.

This article shows how to implement the simplest scenario - read barcode from any supported format without additional settings.

How to scan barcode

To scan barcode from your file, simply call GetBarcodes method.

IEnumerable<PageBarcodeArea> GetBarcodes();

This method returns a collection of PageBarcodeArea objects.

Here are the steps to extract a barcode from file.

  • Instantiate Parser object for the initial file.
  • Check if the file supports barcodes extraction.
  • Call GetBarcodes method and obtain collection of PageBarcodeArea objects.
  • Iterate through the collection and get a barcode value.

The following example shows how to scan barcode: