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

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

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

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

Continuous learning is a crucial part of computer science and this tutorial shows how to read barcode from image with barcode reader SDK in PHP

On this page you will learn from code samples for programming in PHP.Writing of the code to read barcode from image with barcode reader SDK in PHP can be executed by programmers of any level using ByteScout Premium Suite. Want to read barcode from image with barcode reader SDK in your PHP app? ByteScout Premium Suite is designed for it. ByteScout Premium Suite is the bundle that includes twelve SDK products from ByteScout including tools and components for PDF, barcodes, spreadsheets, screen video recording.

The following code snippet for ByteScout Premium Suite works best when you need to quickly read barcode from image with barcode reader SDK in your PHP application. IF you want to implement the functionality, just copy and paste this code for PHP below into your code editor with your app, compile and run your application. Further improvement of the code will make it more robust.

Trial version of ByteScout Premium Suite is available for free. Source code samples are included to help you with your PHP app.

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

Explore ByteScout Premium Suite Documentation

Explore Samples

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

Explore ByteScout Premium Suite Documentation

Explore Samples

Sign Up for ByteScout Premium Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next