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

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

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

How to read barcode from image with barcode reader SDK in PHP using ByteScout Barcode Suite

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

This sample source code below will display you how to read barcode from image with barcode reader SDK in PHP. ByteScout Barcode Suite can read barcode from image with barcode reader SDK. It can be applied from PHP. ByteScout Barcode Suite is the bundle that privides 3 SDK products to generate barcodes (Barcode SDK), read barcodes (Barcode Reaer SDK) and read and write spreadsheets (Spreadsheet SDK).

The following code snippet for ByteScout Barcode Suite works best when you need to quickly read barcode from image with barcode reader SDK in your PHP application. Simply copy and paste in your PHP project or application you and then run your app! Enjoy writing a code with ready-to-use sample PHP codes.

ByteScout Barcode Suite free trial version is available on our website. PHP and other programming languages are supported.

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 Barcode Suite Home Page

Explore ByteScout Barcode Suite Documentation

Explore Samples

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

Explore ByteScout Barcode Suite Documentation

Explore Samples

Sign Up for ByteScout Barcode Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next