ByteScout Data Extraction Suite - PHP - Read barcode from image with BarCode Reader SDK - ByteScout

ByteScout Data Extraction Suite – PHP – Read barcode from image with BarCode Reader SDK

  • Home
  • /
  • Articles
  • /
  • ByteScout Data Extraction Suite – PHP – Read barcode from image with BarCode Reader SDK

How to read barcode from image with barcode reader SDK in PHP with ByteScout Data Extraction Suite

If you want to learn more then this tutorial will show how to read barcode from image with barcode reader SDK in PHP

The coding instructions are formulated to help you to try-out the features without the requirement to write your own code. Want to read barcode from image with barcode reader SDK in your PHP app? ByteScout Data Extraction Suite is designed for it. ByteScout Data Extraction Suite is the bundle that includes three SDK tools for data extraction from PDF, scans, images and from spreadsheets: PDF Extractor SDK, Data Extraction SDK, Barcode Reader SDK.

The following code snippet for ByteScout Data Extraction Suite works best when you need to quickly read barcode from image with barcode reader SDK in your PHP application. This PHP 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! If you want to use these PHP sample examples in one or many applications then they can be used easily.

The trial version of ByteScout Data Extraction Suite can be downloaded for free from our website. It also includes source code samples for PHP and other programming languages.

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

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

HelloWorld.php
      
<?php // this PHP script reads barcodes from image using BarCode Reader SDK /* IMPORTANT: to use COM objects in PHP need to enable it by adding the following line into php.ini: extension=php_com_dotnet.dll If you are usiung EasyPHP DevServer then to edit php.ini just right-click on the tray icon and select "Configuration"->"PHP" */ try { // create reader object $reader = new COM("Bytescout.BarCodeReader.Reader"); // Limit search to 1D barcodes only (exclude 2D barcodes to speed up the search). // Change to bc.BarcodeTypesToFind.SetAll() to scan for all supported 1D and 2D barcodes // or select specific type, e.g. bc.BarcodeTypesToFind.PDF417 = True $bc->BarcodeTypesToFind->SetAll1D(); $bc->ReadFromFile("BarcodePhoto.jpg"); For(i = 0; i< $bc->FoundCount-1; i++) { echo "Found barcode on page #" . $bc->GetFoundBarcodePage(i)) . " with type " . $bc->GetFoundBarcodeType(i) . " and value " & bc.GetFoundBarcodeValue(i) & vbCRLF & " and confidence=" . $bc->GetFoundBarcodeConfidence(i) } } catch(Exception $err) // catch exception if any { header("Content-Type: text/plain"); // switch to plain text output type echo($err->getMessage()); // write error message to the output } ?>

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Data Extraction Suite Home Page

Explore ByteScout Data Extraction Suite Documentation

Explore Samples

Sign Up for ByteScout Data Extraction Suite 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 Data Extraction Suite Home Page

Explore ByteScout Data Extraction Suite Documentation

Explore Samples

Sign Up for ByteScout Data Extraction Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next