How-To: ClearImage

Table of contents
ClearImage functionality is packaged as:
  • ClearImageNet.dll – .NET assembly supports AnyCPU, x86 and x64 development.
  • ClearImage.dll – Windows DLL supports COM and JNI entry points. The DLL is distributed as 32-bit version (ClearImage.dll) and 64-bit version (ClearImage.x64.dll). ClearImage COM is registered during the installation process.

The following describes the essential steps of using ClearImage in various programming environments.

.NET API

.NET is a higher level API implemented in the Inlite.ClearImageNet namespace of ClearImageNet.70.

The ClearImageNet assembly also contains a secondary Inlite.ClearImage namespace that is substantially compatible with the COM API, and is specifically designed to ease the migration from ClearImage COM API applications to .NET. It also supports a few low level functions that are not accessible through the Inlite.ClearImageNet namespace. Since it mirrors the COM API no additional examples are provided.

C#

Add reference to ClearImageNet.70 assembly.
Use try/catch to detect and report errors.

VB

Add reference to ClearImageNet.70 assembly.
Use Try/Catch to detect and report errors.

ClearImage installers automatically place ClearImageNet.dll in the GAC. To use it locally (e.g. from executable file folder) remove it from the GAC either from Inlite Control Center’s Versions tab or running: gacutil -uf ClearImageNet.70

COM API

This is a lower level API to support development in all languages that can interface to the Windows COM model. The examples show usage with VB6, C++, PHP, Delphi, VBScript/ASP. Java calls are accommodated through a COM-Java bridge (such as EzJCom) which use the COM API.

C++

Add this line to each file using ClearImage COM API or to a shared header file. Building x64 project import ClearImage.x64.dll using explicit path rather than progid.

Use try/catch in function calling ClearImage to detect and report errors.

PHP

Create ClearImage COM Server: If    PHP Fatal error: Class ‘COM’ not found  is detected, add this section to php.ini
  [PHP_COM_DOTNET]
  extension=php_com_dotnet.dll
  
ClearImage exceptions can be recorded in a log file configured through php.ini parameters: ‘log_errors’ and ‘error_log’.
Alternatively use try/catch to print error messages:

Delphi

Add ClearImage COM to your project:

  • In Project menu select Import Type Library
  • Select ClearImage COM Server in list box
  • Click on the Create Unit button

For Console (DOS) application:

  • Add to uses ActiveX, Windows
  • Call CoInitialize(nil); before any ClearImage calls
  • Call CoUnInitialize; before exiting the application


Use exception handling, demonstrated in code snippets on this Web Site, to detect and report errors.

VBScript/ASP

Create ClearImage COM Server:

Multiple versions of ClearImage COM can be installed on the same system. Use Inlite Control Center’s Versions tab to check current version and/or activate different version.

Registration-free COM

Alternatively use this manifest to load ClearImage COM in registration-free COM configuration.

Java API

ClearImage core functionality is accessed in the ClearImage DLL through the JNI API.
This DLL comes in 2 Production and 2 Development versions:

  • ClearImage.dll  – 32-bit Production, typically installed in PF\Inlite\ClearImage PDK.N_N_NNNN folder
  • ClearImage.x64.dll  - 64-bit Production, typically installed in PF\Inlite\ClearImage PDK.N_N_NNNN folder
  • ClearImage.dev.dll  - 32-bit Development, typically installed in PF\Inlite\ClearImage SDK.N_N_NNNN folder
  • ClearImage.x64.dev.dll  - 64-bit Development, typically installed in PF\Inlite\ClearImage SDK.N_N_NNNN folder
Where:
  • PF – the "Program Files" folder on 32-bit system and "Program Files (x86)" folder on 64-bit system.
  • N_N_NNNN – ClearImage PDK or SDK version

To use Java API:

  • Add ClearImageJ.jar to CLASSPATH.
  • Configure the ClearImage.dll to be located by the ClearImageJ.jar. Point to the 32-bit or 64-bit version of the ClearImage DLL corresponding to the Java VM version. Options are:
    1. Use location specified by -Djava.library.path on the java command line. Copy appropriate version of the ClearImage DLL to the location specified by java.library.path. Rename the DLL as ClearImage.dll
    2. Use runtime-defined location using the CiServer.loadClearImage method. For example:
    3. Use runtime-defined folder using the CiServer.loadClearImage method. The appropriate version of the ClearImage DLL in specified folder should be named as ClearImage.dll. For example:
  • Instantiate static ICiServer object that is used to create all processing objects.
  • Use try/catch to detect and report errors.

NOTE: The Java API is available only in ClearImage 8. For earlier versions of ClearImage, see how to use the ClearImage COM bridge.