ClearImage SDK
Programming

PHP

Step 1: Install ClearImage SDK

Download and install the ClearImage SDK.

Step 2: Configure ClearImage

PHP code uses ClearImage.dll through COM API. ClearImage DLL is registered as a COM object during installation. To register manually, run the following command as Administrator.

"C:\Program Files (x86)\Inlite\ClearImageSDK\register.bat"

Add this section to php.iniif it has not been set yet.

[PHP_COM_DOTNET] extension=php_com_dotnet.dll fastcgi.impersonate = 0

Error 'Class ‘COM’ not found' indicates that the above is not configured.

ClearImage DLL API reports errors as an Exception object.

PHP


ClearImage project development

Extend functionality

While developing your application, you can combine code examples on this page with methods described in ClearImage API documentation in the ClearImage COM API section.

Barcode Reading

Read 1D barcodes from a page

This example reads code 39 and code 128 barcodes. Set barcode types used in your application. Setting reader->AutoDetect1D=true; automatically finds the barcode type, but it is slower and is not recommended for production.

PHP


Read 2D Barcode from a page

This example reads PDF417, DataMatrix, and QR code.

PHP


2D barcodes might contain binary data in $Bc->Data property as an integer array. To access all elements:

foreach ($Bc->Data as $val) {print " " . $val;}

Read Postal Barcodes from a page

This example reads Postal Barcodes from an image file page.

PHP


Read Driver's License barcode

This example reads the Driver's License barcode from an image file page.

PHP


Read from a multi-page image file

This example reads barcodes from a single-page file or all pages of a multi-page image file.

PHP



Image Processing

Repair image page

This example uses some of the most popular image-processing functions. In a production application, the specific sequence of functions should be selected based on specific application needs. 

PHP


Repair all images in a multi-page file

This example repairs all images in a multi-page file and saves the result in the fileOut file.

PHP