Leadtools.Services.Raster - Used to convert images, as well as provide information about a given image (format, resolution, size, bits per pixel, page count, etc). The following services are exposed via this assembly:

Leadtools.Services.Twain - Used for controlling TWAIN devices, acquiring images from a specified source, and processing the acquired images.

In certain cases, you may want perform multiple image processing functions, one after another. The BatchService is useful in this case because it accepts a list of image processing functions, and executes them all within one call to the server. This saves time and bandwidth since there is only a single round trip to the server, not multiple trips for each function. To use multiple image processing functions, you must create an instance of the Requests class, add each image processing function as a RequestData object, and assign the collection to the BatchRequest.Requests property.

Hosting Options

LEADTOOLS WCF can be hosted multiple ways including IIS, self hosting (managed applications only), windows service, and as a Windows Process Activation Service. For more information on hosting options, see MSDN - Hosting Services. LEADTOOLS also includes several tutorials for hosting and consuming WCF Services. For more information, see WCF Tutorials.

Configuring LEADTOOLS WCF Services

WCF, as well as other features within WCF such as OCR and Barcode. must be unlocked in the toolkit. Unlocking is performed by the following files:

Leadtools.Services.Forms.ServiceImplementations.dll.config

Leadtools.Services.ImageProcessing.ServiceImplementations.dll.config

Leadtools.Services.Raster.ServiceImplementations.dll.config

Leadtools.Services.Forms.ServiceImplementations.dll.config

Each configuration file contains a type of feature and its value. For each feature you have licensed, you will need to specify the corresponding unlock key. For example, Leadtools.Services.Raster.ServiceImplementations.dll.config contains the following section:

Notice that if you are planning on using any of the LEADTOOLS services to load PDF files using PDF legacy mode (or load Postscript and Enhanced Postscript files), then you must also specify the path for the Leadtools.PdfEngine.dll assembly in the configuration file. This path will be used to set the value of the CodecsPdfOptions.InitialPath property. Leadtools.PdfEngine.dll is not a standard .NET assembly and you cannot add it as a reference to your project. Refer to CodecsPdfOptions.InitialPath for more information.

The above is not required if only the LEADTOOLS default PDF loader will be used (Leadtools.Pdf.dll). For more information, refer to Implementing PDF Features.

Here is an example on how to set the path to Leadtools.PdfEngine.dll in the configuration file:

When specifying the OCR Engine to be used by Leadtools.Services.Forms, you must use the following settings in the Leadtools.Services.Forms.ServiceImplementations.dll.config file. This value currently supports "Advantage" for the Advantage Engine, "Professional" for the Professional Engine.

When consuming WCF Services from web-based applications (Silverlight and ASP.NET), Visual Studio will generate asynchronous methods to the service, rather than use single synchronous calls. These asynchronous calls require you to subscribe to the “Completed” event, call the method, and wait for the “Completed” event to fire. The following example illustrates using the necessary methods and events based on the RasterService.svc Convert Method: