dynamsoftsamples/php-barcode-com-component
Composer 安装命令:
composer require dynamsoftsamples/php-barcode-com-component
包简介
Dynamsoft Barcode Reader SDK for PHP - Implement Barcode Recognition to Your App
关键字:
README 文档
README
This is the COM component for making PHP barcode reader.
Getting Started
-
Create a new project named test. Under the project root directory, create two php files - test.php and readbarcode.php. Then copy dynamsoftbarcodereader.php from the SDK package to the project folder.
-
Edit test.php as follows:
<html> <head/> <body> <h1>Dynamsoft Barcode Reader PHP Simple Sample</h1> <form action="readbarcode.php" method="post" enctype="multipart/form-data"> Select barcode image: <input type="file" name="barcodefile" id="barcodefile" accept="image/*" /><br/> <input type="submit" value="Read Barcode" name="submit"/> </form> </body> </html>Edit readbarcode.php as follows:
<?php include "dynamsoftbarcodereader.php"; $uploadfile = $_FILES["barcodefile"]["tmp_name"]; $br = new BarcodeReader(); $br->initLicense("<your license key here>"); $br->decodeFile($uploadfile); $cnt = $br->getBarcodesCount(); echo "Barcode Count: $cnt <br />"; for ($i = 0; $i < $cnt; $i++) { $res = $br->getBarcodeResult($i); echo "$i. $res->BarcodeFormatString , $res->BarcodeText<br />"; } ?>Please replace < your license key here > with valid values. The licenses can be found in the [INSTALL FOLDER]\LicenseManager.exe.
-
Suppose you deploy the sample to WampServer, please copy test folder to [WampServer ROOT PATH]\www folder. Start your WampServer and visit http://[ip]:[port]/test/test.php to verify if it works.
**Note: ** If you recieve the "Class 'COM' not found" error, please check whether the COM extension is enable in php.ini:
extension=php_com_dotnet.dll
统计信息
- 总下载量: 43
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2016-01-28