Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 83

LS100

SERVICE INTERFACE

By
C.T.S. Electronics s.r.l.
Corso Vercelli 332
10015 IVREA (TO)

tel. ++390125235611
fax. ++390125235623
sito: www.ctsgroup.it
mail: techsupp@ctsgroup.it

Last revision : 18 November 2005


LS100 Service Interface

Contents

1. Overview............................................................................................................................................4
2. Interface Functions Description.........................................................................................................5
3. Basic functions...................................................................................................................................6
3.1. LS100_Open..............................................................................................................................6
3.2. LS100_Close..............................................................................................................................7
3.3. LS100_GetVersion....................................................................................................................8
3.4. LS100_Identify..........................................................................................................................9
3.5. LS100_DocHandle...................................................................................................................11
3.6. LS100_DocHandleOverlapped................................................................................................13
3.7. LS100_DocHandleAndGetData..............................................................................................16
3.8. LS100_SetThresholdClearBlack..............................................................................................20
3.9. LS100_ReadImage...................................................................................................................21
3.10. LS100_ReadImagePiece......................................................................................................23
3.11. LS100_ReadBadge..............................................................................................................25
3.12. LS100_ReadBadgeWithTimeout.........................................................................................26
3.13. LS100_ReadCodeline..........................................................................................................28
3.14. LS100_CodelineReadFromBitmap......................................................................................29
3.15. LS100_ReadCodelineFromBitmap......................................................................................32
3.16. LS100_ReadBarcodeFromBitmap.......................................................................................34
3.17. LS100_ReadPdf417FromBitmap.........................................................................................36
3.18. LS100_LoadString...............................................................................................................38
3.19. LS100_LoadMultiString......................................................................................................39
3.20. LS100_Reset........................................................................................................................41
3.21. LS100_Wait.........................................................................................................................42
3.22. LS100_Test..........................................................................................................................43
3.23. LS100_PeriphStatus.............................................................................................................44
3.24. LS100_DoubleLeafingSensibility........................................................................................46
3.25. LS100_HistoryCommand....................................................................................................47
4. Image manipulation functions..........................................................................................................48
4.1. LS100_SaveJPEG....................................................................................................................49
4.2. LS100_SaveDIB......................................................................................................................50
4.3. LS100_SaveTIFF.....................................................................................................................51
4.4. LS100_RotateImage................................................................................................................52
4.5. LS100_ImageBrightness..........................................................................................................53
4.6. LS100_ImageContrast.............................................................................................................54
4.7. LS100_CutImage.....................................................................................................................55
4.8. LS100_ConvertImageToBW...................................................................................................57
4.9. LS100_ConvertImageToBWEx...............................................................................................58
4.10. LS100_ConvertImage200To100dpi....................................................................................60
4.11. LS100_FreeImage................................................................................................................61
4.12. LS100_DisplayImage..........................................................................................................62
4.13. LS100_UpdateImage...........................................................................................................64
5. Advanced document handling functions..........................................................................................65
5.1. LS100_AutoDocHandleEx......................................................................................................66
C.T.S. Electronics Page 2 of 83
LS100 Service Interface

5.2. LS100_AutoDocHandle...........................................................................................................70
5.3. LS100_GetDocData.................................................................................................................74
6. Debug and Download functions.......................................................................................................76
6.1. LS100_ViewOCRRectangle....................................................................................................77
6.2. LS100_DownloadFirmware.....................................................................................................78
7. Application Program Guideline.......................................................................................................79
8. Reply Codes.....................................................................................................................................81

C.T.S. Electronics Page 3 of 83


LS100 Service Interface

1. Overview
This document contains the specification of the LS100 USB and LS100 RS232 service interface functions for the
Win32 subsystem of the Windows operating system.
The goal of this document is to provide specific information about LS100 interface functions and about
development of application programs that make use of it; the reader must have a background known of Win32
environment architecture and programming technique.
For information about the LS100 peripheral features please look at proper documentation.

C.T.S. Electronics Page 4 of 83


LS100 Service Interface

2. Interface Functions Description

All functions available with LS100 service are contained into the LS100.DLL.

To build an application program that make use of this interface functions is necessary to include the file named
LS100.H and link LS100.LIB library.
To start an application program that use this service is necessary to install in the application directory the files
listed below :
 LS100.DLL

LS100 service is available in two version :


 standard software distribution kit
 complete software distribution kit

The standard software distribution kit contain the basic function to manage the LS100 peripheral, its contain the
following module :
 LS100.DLL
 LS100.H
 LS100.LIB

The complete software distribution kit add a set of additional function over the basic and contain the following
module :
 LS100.DLL
 LS100.H
 LS100.LIB
 IMG_UTIL.DLL
 LFBMP13N.DLL
 LFCMP13N.DLL
 LFFAX13N.DLL
 LTDIS13N.DLL
 LTDLG13N.DLL
 LTFIL13N.DLL
 LTIMG13N.DLL
 LTKRN13N.DLL
 LTEFX13N.DLL

All functions can be executed in suspensive or not-suspensive mode, but no more than one function can be
executed at the same time.

C.T.S. Electronics Page 5 of 83


LS100 Service Interface

3. Basic functions
This functions are the base service routine to manage the peripheral.

3.1. LS100_Open
#include "LS100.h"

Result API LS100_Open (HWND hwnd,


HANDLE Hinst,
CHAR Type_com);

Description
Open a connection between client and LS service.

Parameters
Hwnd
Handle of the application windows which will receive the notification messages.
Hinst
Hinstance of the application window.
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)

Return Value
LS100_OKAY if successful
LS100_TRY_TO_RESET if the peripheral is in error state otherwise standard reply code.

Comments

C.T.S. Electronics Page 6 of 83


LS100 Service Interface

3.2. LS100_Close
#include "LS100.h"

Result API LS100_Close (HWND hwnd,


CHAR Type_com);

Description
Close a connection between a client and LS service.

Parameters
Hwnd
Handle of the application windows which will receive the notification messages.
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)

Return Value
LS100_OKAY if successful
LS100_OPEN_NOT_DONE

Comments

C.T.S. Electronics Page 7 of 83


LS100 Service Interface

3.3. LS100_GetVersion
#include "LS100.h"

Result API LS100_GetVersion(CHAR * VersionLibrary,


SHORT LengthStr);

Description
Return the version of the library.

Parameters
VersionLibrary
This is a string that containe the release of the library, the max length of this string is 64 bytes.
LengthStr
Length of the string in input.

Return Value
LS100_OKAY if successful.
LS100_STRINGTRUNCATED

Comments

C.T.S. Electronics Page 8 of 83


LS100 Service Interface

3.4. LS100_Identify
#include "LS100.h"

Result API LS100_Identify( HWND hwnd,


CHAR Type_com,
LPSTR lpldPnt,
LPSTR VendorModel,
LPSTR ProductVersion,
LPSTR DecoderExpVersion,
LPSTR InkJetVersion);

Description
Gets specific information about hardware configuration of the peripheral device assigned to the service.

Parameters
Hwnd
Handle of the application windows which will receive the notification messages.
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)
LpldPnt
Pointer to an area of 5 bytes containing the primary and secondary identifier of the currently
assigned LS100 peripheral (see table below).
VendorModel
Pointer to a string that will contain the peripheral model.
ProductVersion
Pointer to a string that will contain the firmware revision of the peripheral.
DecoderExpVersion
Pointer to a string that will contain the firmware revision of the decoder board expansion.
InkJetVersion
Pointer to a string that will contain the firmware revision of the inkjet board expansion.

Return Value
LS100_OKAY
LS100_SERVERSYSERR
LS100_USBERR
LS100_PERIFNOTFOUND
LS100_HARDERR
LS100_RESERVERR
LS100_BOURRAGE
LS100_INVALIDCMD
LS100_DATALOST
LS100_EXECCMD

Comments
This function can be used only after a LS100_Open operation has been correctly executed.

C.T.S. Electronics Page 9 of 83


LS100 Service Interface

Byte Order Contents Type Bit Information Value

First Primary Char Peripheral 'D' ( 44Hex)


Identifier Type
Second Secondary Bit 0 MICR 0 = not available
Identifier Reader 1 = available
Bit 1 n.u.
Bit 2 Ink-jet 0 = not available
Printer Front 1 = available
Bit 3 Ink-jet 0 = not available
Printer Rear 1 = available
Bit 4 n.u.
Bit 5 Front Stamp 0 = not available
1 = available
Bit 6 Reserved always 1
Bit 7 Reserved always 0
Third Secondary Bit 0 Front 0 = not available
Identifier Scanner 1 = available
Bit 1 Rear 0 = not available
Scanner 1 = available
Bit 2 Badge 0 = not available
Reader 1 = available
Bit 3 n.u.
Bit 4 n.u.
Bit 5 n.u.
Bit 6 Reserved always 1
Bit 7 Reserved always 0
Fourth Secondary Bits 0 n.u.
Identifier
Bit 1 n.u.
Bit 2 n.u.
Bit 3 n.u.
Bit 4 n.u.
Bit 5 n.u.
Bit 6 Reserved always 1
Bit 7 Reserved always 0
Fifth Secondary Bits 0 n.u.
Identifier
Bit 1 n.u.
Bit 2 n.u.
Bit 3 n.u.
Bit 4 n.u.
Bit 5 n.u.
Bit 6 Reserved always 1

C.T.S. Electronics Page 10 of 83


LS100 Service Interface

Bit 7 Reserved always 0

3.5. LS100_DocHandle
#include "LS100.h"

Result API LS100_DocHandle ( HWND hwnd,


char Type_com,
short FrontStamp,
short Validate,
short CodeLine,
char Side,
short ScanMode,
short Feeder,
short Sorter,
short WaitTimeout,
short Beep,
unsigned long *NrDoc,
short Reserved1,
long Reserved2);

Description
Execute physical handling of document as specified by parameters values.

Parameters
hwnd
Handle of the application windows which will receive the notification messages.
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)
FrontStamp
NO_FRONT_STAMP = do not execute front stamp
FRONT_STAMP = execute front stamp
Validate
NO_PRINT_VALIDATE = do not print validation string
PRINT_VALIDATE = print validation string
Codeline
NO_READ_CODELINE = do not read codeline.
READ_CODELINE_MICR = read in magnetic codeline CMC7 or E13B.
Side
Set the image to read
SIDE_FRONT_IMAGE = Read Front Image
SIDE_BACK_IMAGE = Read Back Image
SIDE_ALL_IMAGE = Read Both Images
SIDE_NONE_IMAGE = Do not read Image
ScanMode
This parameter set the resolution for the image to film as follow :
SCAN_MODE_BW = 2 grey scale at 200 dpi
SCAN_MODE_BW_TIFF = Transfer the image from peripheral to PC in TIFF 2 mode (only for
the version RS_ )
SCAN_MODE_16GR100 = 16 grey scale at 100 dpi

C.T.S. Electronics Page 11 of 83


LS100 Service Interface

SCAN_MODE_16GR200 = 16 grey scale at 200 dpi


SCAN_MODE_256GR100 = 256 grey scale at 100 dpi
SCAN_MODE_256GR200 = 256 grey scale at 200 dpi
SCAN_MODE_COLOR_100 = 24 bit color scale at 100 dpi
SCAN_MODE_COLOR_200 = 24 bit color scale at 200 dpi
SCAN_MODE_COLOR_AND_RED_100 = 24 bit color scale at 100 dpi and only red image
SCAN_MODE_COLOR_AND_RED_200 = 24 bit color scale at 200 dpi and only red image
Feeder
AUTOFEED = document from feeder.
PATHFEED = document from path (after a retained).
Sorter
HOLD_DOCUMENT = hold document.
SORTER_BAY1 = document sorter.
EJECT_DOCUMENT = the document was returned in the feeder.
WaitTimeout
This parameter allow to wait the peripheral timeout after the last document in the leafer.
WAIT_YES = wait the peripheral timeout
WAIT_NO = don't wait the peripheral timeout
Beep
Set the beep sound on the peripheral when an error occur
NO_BEEP : no beep is allowed
BEEP : beep is allowed
NrDoc
Return the number of the document processed, this ID must be used for read the codeline
and/or the image(s).
Reserved1
Reserved for future improvement, must be set NULL.
Reserved2
Reserved for future improvement, must be set NULL.

Return Value
LS100_OKAY
LS100_SERVERSYSERR
LS100_USBERR
LS100_PERIFNOTFOUND
LS100_HARDERR
LS100_RESERVERR
LS100_BOURRAGE
LS100_INVALIDCMD
LS100_EXECCMD

Comments
All data obtained from document handling are not returned to the client but are stored by the peripheral
and can be requested later by the client using LS100_ReadImage or LS100_ReadCodeline functions.

C.T.S. Electronics Page 12 of 83


LS100 Service Interface

3.6. LS100_DocHandleOverlapped
#include "LS100.h"

Result API LS100_DocHandleOverlapped(HWND hwnd,


char Type_com,
short FrontStamp,
short Validate,
short CodeLine,
char Side,
short ScanMode,
short ClearBlack,
short WaitTimeout,
short Beep,
short NumDocument,
short Reserved1,
long Reserved2,
int (__stdcall *userfunc1)(S_CODELINE_INFO *CodelineInfo),
int (__stdcall *userfunc2)(S_IMAGE_INFO *ImageInfo),
int (__stdcall *userfunc3)(S_IMAGE_INFO *ImageInfo),
void *Reserved3);

Description
Execute physical handling of document as specified by parameters values in overlapped mode with the
codeline and the images, then a document is processed in asynchronous mode the library call the call-
back specified then the codeline or the images are available.

Parameters
hwnd
Handle of the application windows which will receive the notification messages.
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)
FrontStamp
NO_FRONT_STAMP = do not execute front stamp
FRONT_STAMP = execute front stamp
Validate
NO_PRINT_VALIDATE = do not print validation string
PRINT_VALIDATE = print validation string
Codeline
NO_READ_CODELINE = do not read codeline.
READ_CODELINE_MICR = read in magnetic codeline CMC7 or E13B.
Side
Set the image to read
SIDE_FRONT_IMAGE = Read Front Image
SIDE_BACK_IMAGE = Read Back Image
SIDE_ALL_IMAGE = Read Both Images
SIDE_NONE_IMAGE = Do not read Image
ScanMode
This parameter set the resolution for the image to film as follow :
SCAN_MODE_BW = 2 grey scale at 200 dpi
C.T.S. Electronics Page 13 of 83
LS100 Service Interface

SCAN_MODE_16GR100 = 16 grey scale at 100 dpi


SCAN_MODE_16GR200 = 16 grey scale at 200 dpi
SCAN_MODE_256GR100 = 256 grey scale at 100 dpi
SCAN_MODE_256GR200 = 256 grey scale at 200 dpi
ClearBlack
Clear the black area of the image
NO_CLEAR_BLACK = no image cleaning, the black area is not removed.
CLEAR_ALL_BLACK = clean the document's image removing all the black around the image.
WaitTimeout
This parameter allow to wait the peripheral timeout after the last document in the leafer.
WAIT_YES = wait the peripheral timeout
WAIT_NO = don't wait the peripheral timeout
Beep
Set the beep sound on the peripheral when an error occur
NO_BEEP : no beep is allowed
BEEP : beep is allowed
NumDocument
This parameter set the maximum number of document to read.
0 = read all document present put in the feeder in a time of 6 second from one to other.
Reserved1
Reserved for future improvement, must be set NULL.
Reserved2
Reserved for future improvement, must be set NULL.
(*userfunc1)(S_CODELINE_INFO *CodelineInfo)
Function call-back called from the library then the codeline is available.
(*userfunc2)(S_ IMAGE _INFO *ImageInfo)
Function call-back called from the library then the front image is available.
(*userfunc3)(S_ IMAGE _INFO *ImageInfo)
Function call-back called from the library then the rear image is available.
Reserved3
Reserved for future improvement, must be set NULL.

Return Value
LS100_OKAY
LS100_SERVERSYSERR
LS100_USBERR
LS100_PERIFNOTFOUND
LS100_HARDERR
LS100_RESERVERR
LS100_BOURRAGE
LS100_OPEN_NOT_DONE
LS100_EXECCMD
LS100_CMDSEQUENCEERROR
LS100_INVALID_TYPE_CMD
LS100_INVALID_FRONTSTAMP
LS100_INVALID_VALIDATE
LS100_INVALID_CODELINE_TYPE
LS100_INVALID_SIDE
LS100_INVALID_SCANMODE
LS100_INVALID_CLEARBLACK
LS100_INVALID_WAITTIMEOUT
LS100_INVALID_BEEP_PARAM

Comments
This function permit of use the scanner LS100 as peripheral of codeline reader (like to L70, L100 etc. ).
C.T.S. Electronics Page 14 of 83
LS100 Service Interface

In fact is possible then the codeline is available the library call the call-back relative and the peripheral is
immediately ready for process another document, the images of the document processed are give at the
application in a second time just available, the peripheral can store five images as max with document
length 216 mm.

Description of the structures give as parameter :

typedef struct _S_CODELINE_INFO


{
short Size; // Size of the struct
unsigned long NrDoc; // Progessive document number
char CodelineRead[CODE_LINE_LENGTH]; // Codeline returned
short NrBytes; // Length of the codeline
} S_CODELINE_INFO, *LPS_CODELINE_INFO;

typedef struct _S_IMAGE_INFO


{
short Size; // Size of the struct
unsigned long NrDoc; // Progressive document number
HANDLE hImage; // Image handle
int ImageSize; // Image size bytes
int Width; // Image width
int Height; // Image height
int Resolution; // Image resolution
int BitCount; // Image bit count (level of grey)
} S_IMAGE_INFO, *LPS_IMAGE_INFO;

C.T.S. Electronics Page 15 of 83


LS100 Service Interface

3.7. LS100_DocHandleAndGetData
#include "LS100.h"

Result API LS100_DocHandleAndGetData ( HWND hwnd,


char Type_com,
short FrontStamp,
short Validate,
short Codeline,
short ScanMode,
short ClearBlack,
char Side,
short SaveImage,
char *DirectoryFile,
char *BaseFilename,
int Start_X,
int Start_Y,
int sizeW,
int sizeH,
int Quality,
short FileFormat,
short WaitTimeout,
short Beep,
int SaveMode,
int PageNumber,
short Reserved1,
LPVOID Reserved2,
unsigned long *NrDoc,
LPSTR FilenameFront,
LPSTR FilenameBack,
LPSTR FilenameFrontNetto,
LPSTR FilenameBackNetto,
LPLONG *FrontImage,
LPLONG *Backmage,
LPLONG *FrontImageNetto,
LPLONG *BackmageNetto,
LPSTR CodelineSW,
LPSTR CodelineHW,
LPSTR Barcode,
LPVOID CodelinesOptical,
LPVOID Reserved7,
LPVOID Reserved8);

Description
Execute physical handling of document as specified by parameters values and return the data
elaborated.

Parameters
Hwnd
Handle of the application windows which will receive the notification messages
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
C.T.S. Electronics Page 16 of 83
LS100 Service Interface

NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the


command completes or use LS100_Test to check command processing status)
FrontStamp
NO_FRONT_STAMP = do not execute front stamp
FRONT_STAMP = execute front stamp
Validate
NO_PRINT_VALIDATE = do not print validation string
PRINT_VALIDATE = print validation string
Codeline
Specify the type of codeline to read.
NO_READ_CODELINE = do not read codeline.
READ_CODELINE_MICR = read magnetic codeline CMC7 or E13B.
READ_CODELINE_SW_OCRA = read codeline from the position specified by X, Y and Size
parameters. The co-ordinate start from bottom left corner of the
document.
READ_CODELINE_SW_OCRB_NUM = read codeline from the position specified by X, Y and
Size parameters. The co-ordinate start from bottom left corner
of the document.
READ_CODELINE_SW_OCRB_ITALY = read codeline from the position specified by X, Y and
Size parameters. The co-ordinate start from bottom left corner
of the document.
READ_CODELINE_SW_OCRB_ALFANUM = read codeline from the position specified by X, Y
and Size parameters. The co-ordinate start from bottom left
corner of the document.
READ_CODELINE_SW_E13B = read codeline from the position specified by X, Y and Size
parameters. The co-ordinate start from bottom left corner of the
document.
ScanMode
This parameter set the resolution for the image to read
SCAN_MODE_BW = 2 grey scale at 200 dpi
SCAN_MODE_BW_TIFF = Transfer the image from peripheral to PC in TIFF 2 mode (only for
the version RS_ )
SCAN_MODE_16GR100 = 16 grey scale at 100 dpi
SCAN_MODE_16GR200 = 16 grey scale at 200 dpi
SCAN_MODE_256GR100 = 256 grey scale at 100 dpi
SCAN_MODE_256GR200 = 256 grey scale at 200 dpi
SCAN_MODE_COLOR_100 = 24 bit color scale at 100 dpi
SCAN_MODE_COLOR_200 = 24 bit color scale at 200 dpi
SCAN_MODE_COLOR_AND_RED_100 = 24 bit color scale at 100 dpi and only red image
SCAN_MODE_COLOR_AND_RED_200 = 24 bit color scale at 200 dpi and only red image
ClearBlack
Clear the black area of the image
NO_CLEAR_BLACK = no image cleaning, the black area is not removed.
CLEAR_ALL_BLACK = clean the document's image removing all the black around the image.
Side
Set the image to read
SIDE_FRONT_IMAGE = Read Front Image
SIDE_BACK_IMAGE = Read Back Image
SIDE_ALL_IMAGE = Read Both Images
SIDE_NONE_IMAGE = Do not read Image
SaveImage
Set how to save the image read
IMAGE_SAVE_ON_FILE = save on file the image
IMAGE_SAVE_HANDLE = save the image in memory
IMAGE_SAVE_BOTH = save the image in memory and in file
IMAGE_SAVE_NONE = do not save on file.
DirectoryFile
C.T.S. Electronics Page 17 of 83
LS100 Service Interface

Directory where saving the image


BaseFilename
Base of the file name for image. For example if you set AA to this parameter the jpeg files
created will be AA0FF.jpg, for front image.
Start_X
Specify the co-ordinate (in pixel) from left or right margin of the document.
Start_Y
Specify the y position (in pixel) of the codeline from bottom margin of the document.
SizeW
Specify the size (in pixel) of the codeline contained in the bitmap.
SizeH
For the moment accept only the value MAX_PIXEL_HEIGHT.
Quality
Integer from 2 to 255 that indicates the relationship between Quality and compression:
2 = max quality,
255 = max compression.
FileFormat
This parameter set the file format for the document's images.
The only value allowed in this moment are :
SAVE_JPEG : save the image in a JPEG format file.
SAVE_BMP : save the image in a DIB format file.
FILE_TIF : save the image in a Tagged Image File Format file.
FILE_CCITT : save the image in a TIFF CCITT file.
FILE_CCITT_GROUP3_1DIM : save the image in a CCITT Group3 one dimension file.
FILE_CCITT_GROUP3_2DIM : save the image in a CCITT Group3 two dimensions file.
FILE_CCITT_GROUP4 : save the image in a CCITT Group4 two dimensions file.
WaitTimeout
This parameter allow to wait the peripheral timeout after the last document in the leafer.
WAIT_YES = wait the peripheral timeout
WAIT_NO = don't wait the peripheral timeout
Beep
Set the beep sound on the peripheral when an error occur
NO_BEEP : no beep is allowed
BEEP : beep is allowed
SaveMode
SAVE_OVERWRITE = Overwrite the file.
SAVE_APPEND = Append the image in a multi-page file images.
SAVE_REPLACE = Replace a image in a multi-page file images.
SAVE_INSERT = Insert the image in a multi-page file images.
PageNumber
Number of the position in a multi-page file.
Reserved1
Reserved for future improvement, must be set NULL.
Reserved2
Reserved for future improvement, must be set NULL.
NrDoc
Return the number of the document processed, this ID must be used for read the codeline
and/or the image(s).
FilenameFront
Name of the file where the front image is stored.
FilenameBack
Name of the file where the back image is stored.
FilenameFrontNetto
Name of the file where the front Netto image is stored.
FilenameBackNetto
Name of the file where the back Netto image is stored.
*FrontImage
C.T.S. Electronics Page 18 of 83
LS100 Service Interface

Pointer to a long pointer where will be returned the handle of the front image memory stored by
the service.
*Backmage
Pointer to a long pointer where will be returned the handle of the back image memory stored by
the service.
*FrontImageNetto
Pointer to a long pointer where will be returned the handle of the front Netto image memory
stored by the service.
*BackmageNetto
Pointer to a long pointer where will be returned the handle of the back Netto image memory
stored by the service.
CodelineSW
This string will contain the codeline software required.
CodelineHW
This sting will contain the hardware codeline.
Barcode
This sting will contain the barcode codeline (Not available at this moment).
CodelinesOptical
This sting will contain the codelines optical (Not available at this moment).
*Reserved7
Reserved for future improvement, must be set NULL.
*Reserved8
Reserved for future improvement, must be set NULL.

Return Value
LS100_OKAY
LS100_SERVERSYSERR
LS100_USBERR
LS100_PERIFNOTFOUND
LS100_HARDERR
LS100_RESERVERR
LS100_BOURRAGE
LS100_INVALIDCMD
LS100_DATALOST
LS100_EXECCMD

Comments
The area memory occupated from the bitmap was destroied from the application.

C.T.S. Electronics Page 19 of 83


LS100 Service Interface

3.8. LS100_SetThresholdClearBlack
#include "LS100.h"

Result API LS100_SetThresholdClearBlack ( HWND hwnd,


char Type_com,
unsigned char Threshold);

Description
This function set the black threshold for clear the black around the image filmed, used inside the
LS100_ReadImage.

Parameters
Hwnd
Handle of the application windows which will receive the notification messages.
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
Threshold
Value of black used as threshold for clear image, range 0 (black) to 255 (white), the default is
DEFAULT_BLACK_THRESHOLD.

Return Value
LS100_OKAY
LS100_EXECCMD
LS100_CMDSEQUENCEERROR
LS100_INVALID_TYPE_CMD
LS100_OPEN_NOT_DONE

Comments

C.T.S. Electronics Page 20 of 83


LS100 Service Interface

3.9. LS100_ReadImage
#include "LS100.h"

Result API LS100_ReadImage (HWND hwnd,


CHAR Type_com,
short ClearBlack,
CHAR Side,
unsigned long NrDoc,
LPHANDLE FrontImage,
LPHANDLE BackImage,
LPHANDLE FrontImageNetto,
LPHANDLE BackImageNetto);

Description
This function can be used by client to obtain the images of front and/or back side of a document
previously handled by LS100_DocHandle.

Parameters
Hwnd
Handle of the application windows which will receive the notification messages.
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)
ClearBlack
Clear the black area of the image.
NO_CLEAR_BLACK = no image cleaning, the black area is not removed.
CLEAR_ALL_BLACK = clean the document's image removing all the black around the image.
Side
Set the image side to read :
SIDE_FRONT_IMAGE = Front image.
SIDE_BACK_IMAGE = Back image.
SIDE_ALL_IMAGE = Front and Back images.
SIDE_FRONT_BLUE_IMAGE = Front Blue image.
SIDE_BACK_BLUE_IMAGE = Back Blue image.
SIDE_ALL_BLUE_IMAGE = Front and Back Blue images.
SIDE_FRONT_GREEN_IMAGE = Front Green image.
SIDE_BACK_GREEN_IMAGE = Back Green image.
SIDE_ALL_GREEN_IMAGE = Front and Back Green images.
SIDE_FRONT_RED_IMAGE = Front Red image.
SIDE_BACK_RED_IMAGE = Back Red image.
SIDE_ALL_RED_IMAGE = Front and Back Red images.
NrDoc
Number ID of the document that want load or reload the image.
FrontImage
Pointer to a handle where will be returned the handle of memory buffer containing the image of
front side of document in DIB format.
BackImage
Pointer to a handle where will be returned the handle of memory buffer containing the image of
back side of document in DIB format.
FrontImageNetto
C.T.S. Electronics Page 21 of 83
LS100 Service Interface

Pointer to a handle where will be returned the handle of memory buffer containing the Netto
image of front side of document in DIB format.
BackImageNetto
Pointer to a handle where will be returned the handle of memory buffer containing the Netto
image of back side of document in DIB format.

Return Value
LS100_OKAY
LS100_SERVERSYSERR
LS100_USBERR
LS100_PERIFNOTFOUND
LS100_HARDERR
LS100_PERIFOFFON
LS100_OPEN_NOT_DONE
LS100_CMDSEQUENCEERROR
LS100_INVALID_TYPE_CMD
LS100_INVALID_CLEARBLACK
LS100_INVALID_SIDE
LS100_IMAGE_NO_MORE_AVAILABLE

Comments
The image handle retrieve by this function must be released by the application with the function
LS100_FreeImage().

C.T.S. Electronics Page 22 of 83


LS100 Service Interface

3.10. LS100_ReadImagePiece
#include "LS100.h"

Result API LS100_ReadImagePiece(HWND hwnd,


CHAR Type_com,
CHAR Side,
unsigned long NrDoc,
int pos_x,
int pos_y,
int sizeW,
int sizeH,
LPHANDLE hImage);

Description
This function can be used by client to obtain a piece of the images of the front or back side of a
document previously handled by LS100_DocHandle.
All the parameter position are in millimeters.
This function work only with the grey image.

Parameters
Hwnd
Handle of the application windows which will receive the notification messages.
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)
Side
Set the image side to read :
SIDE_FRONT_IMAGE = Front image
SIDE_BACK_IMAGE = Back image
NrDoc
Number ID of the document that want load or reload the image.
Pos_x
Coordinate X in millimeters of the cut image on the document.
Pos_y
Coordinate Y in millimeters of the cut image on the document.
sizeW
Width in millimeters of the cut image.
sizeH
Height in millimeters of the cut image.
hImage
Pointer to a handle where will be returned the handle of memory buffer containing the piece of
the image cut from the document in DIB format.

Return Value
LS100_OKAY
LS100_SERVERSYSERR
LS100_USBERR
LS100_PERIFNOTFOUND
LS100_HARDERR
C.T.S. Electronics Page 23 of 83
LS100 Service Interface

LS100_PERIFOFFON
LS100_OPEN_NOT_DONE
LS100_CMDSEQUENCEERROR
LS100_INVALID_TYPE_CMD
LS100_INVALID_CLEARBLACK
LS100_INVALID_SIDE
LS100_IMAGE_NO_MORE_AVAILABLE

Comments
The image handle retrieve by this function must be released by the application.

IMPORTANT:
For the image Front the point 0,0 is the bottom right of the document.
For the image Back the point 0,0 is the bottom left of the document.

C.T.S. Electronics Page 24 of 83


LS100 Service Interface

3.11. LS100_ReadBadge
#include "LS100.h"

Result API LS100_ReadBadge (HWND hwnd,


CHAR Type_com,
CHAR Format,
SHORT  MaxLength,
LPSTR String,
SHORT *Length);

Description
Reads badge traces. The function terminate when for one of the follow event :
A badge is read or the function LS100_Reset() is called.

Parameters
hwnd
Handle of the application windows which will receive the notification messages
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)
Format
FORMAT_IATA = IATA
FORMAT_ABA = ABA
FORMAT_MINTS = MINTS
FORMAT_IATA_ABA = IATA + ABA
FORMAT_ABA_MINTS = ABA + MINTS
FORMAT_IATA_ABA_MINTS = IATA + ABA + MINTS
MaxLength
Length of buffer where data read from badge will be returned.
String
Buffer where data read from badge will be returned.
Length
Length of data read from badge.

Return Value
LS100_OKAY
LS100_SERVERSYSERR
LS100_USBERR
LS100_PERIFNOTFOUND
LS100_HARDERR
LS100_PERIFOFFON
LS100_INVALID_BADGE_TRACK
LS100_DATATRUNC

Comments
The traces string returned start with the character 't'.
For interrupt a LS100_ReadBadge() pending call the function LS100_Reset().

C.T.S. Electronics Page 25 of 83


LS100 Service Interface

3.12. LS100_ReadBadgeWithTimeout
#include "LS100.h"

Result API LS100_ReadBadgeWithTimeout(HWND hwnd,


char Type_com,
char Format,
short MaxLength,
LPSTR String,
short *Length,
long Timeout);

Description
Reads badge traces, the difference with the LS100_ReadBadge() is the timeout associated.
The function terminate when for one of the follow event :
A badge is read, the timeout is expired or the function LS100_Reset() is called.

Parameters
hwnd
Handle of the application windows which will receive the notification messages
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
Format
FORMAT_IATA = IATA
FORMAT_ABA = ABA
FORMAT_MINTS = MINTS
FORMAT_IATA_ABA = IATA + ABA
FORMAT_ABA_MINTS = ABA + MINTS
FORMAT_IATA_ABA_MINTS = IATA + ABA + MINTS
MaxLength
Length of buffer where data read from badge will be returned.
String
Buffer where data read from badge will be returned.
Length
Length of data read from badge.
Timeout
Timeout value expressed in milliseconds, this parameter accept as minor value MIN_TIMEOUT
(500 ms).

Return Value
LS100_OKAY
LS100_SERVERSYSERR
LS100_USBERR
LS100_PERIFNOTFOUND
LS100_HARDERR
LS100_PERIFOFFON
LS100_INVALID_TYPE_CMD
LS100_INVALID_BADGE_TRACK
LS100_INVALID_BADGE_TIMEOUT
LS100_DATATRUNC

C.T.S. Electronics Page 26 of 83


LS100 Service Interface

Comments
The traces string returned start with the character 't'.
For interrupt a LS100_ReadBadgeWithTimeout() pending call the function LS100_Reset().

C.T.S. Electronics Page 27 of 83


LS100 Service Interface

3.13. LS100_ReadCodeline
#include "LS100.h"

Result API LS100_ReadCodeline (HWND hwnd,


CHAR Type_com,
LPSTR Codeline,
SHORT *Length_Codeline
LPSTR Reserved1,
SHORT Reserved2);

Description
This function can be used by client to obtain from peripheral the codeline of a document previously
handled by LS100_DocHandle.

Parameters
hwnd
Handle of the application windows which will receive the notification messages.
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)
Codeline
Pointer to the user buffer where codeline will be transferred by the service.
Length_Codeline
Pointer to a variable of input/output, input specify the max size of the buffer pointed by Codeline
parameter, output will contain the effective size of the codeline transferred by the service.
Reserved1
Reserved for future improvement, must be set NULL.
Reserved2
Reserved for future improvement, must be set 0.

Return Value
LS100_OKAY
LS100_SERVERSYSERR
LS100_USBERR
LS100_PERIFNOTFOUND
LS100_HARDERR
LS100_PERIFOFFON
LS100_BOURRAGE
LS100_INVALIDCMD
LS100_DATATRUNC

Comments
Note that this string is returned from the peripheral, so the codeline string is available only if the
hardware codeline reader is installed.
In case of more one optical codeline this are separated with a NULL.

C.T.S. Electronics Page 28 of 83


LS100 Service Interface

3.14. LS100_CodelineReadFromBitmap
#include "LS100.h"

Result API LS100_CodelineReadFromBitmap( HWND hwnd,


CHAR Type_com,
HANDLE hImage,
char *CodelineType,
short UnitMeasure,
float Start_x,
float Start_y,
float sizeW,
float sizeH,
READOPTIONS *CodelineOpt,
LPSTR Codeline,
UINT *Length);

Description
This function allows to read a string of the types CodelineType from the document in all position of this.

Parameters
hwnd
Handle of the application windows which will receive the notification messages.
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)
hImage
Handle of the bitmap that contain the codeline to read.
CodelineType
Specify the type of codeline to read.
READ_CODELINE_SW_OCRA = read codeline from the position specified by X, Y and Size
parameters. The co-ordinate start from bottom left corner of the
document.
READ_CODELINE_SW_OCRB_NUM = read codeline from the position specified by X, Y and
Size parameters. The co-ordinate start from bottom left corner
of the document.
READ_CODELINE_SW_OCRB_ALFANUM = read codeline from the position specified by X, Y
and Size parameters. The co-ordinate start from bottom left
corner of the document.
READ_CODELINE_SW_OCRB_ITALY = read codeline from the position specified by X, Y and
Size parameters. The co-ordinate start from bottom left corner
of the document.
READ_CODELINE_SW_E13B = read codeline from the position specified by X, Y and Size
parameters. The co-ordinate start from bottom left corner of the
document.
UnitMeasure
Specify if the Start_X, Start_Y and SizeW measures are give in millimeter or in inch.
The values are UNIT_MM and UNIT_INCH.
Start_X
Specify the x co-ordinate from right margin of the document.
Start_Y
C.T.S. Electronics Page 29 of 83
LS100 Service Interface

Specify the y co-ordinate from bottom margin of the document.


SizeW
Specify the size of the window contained in the bitmap.
SizeH
For the moment accept only the value :
OCR_VALUE_IN_MM for the measures expressed in millimeter.
OCR_VALUE_IN_INCH for the measures expressed in inch.
CodelineOpt
Pointer to structure READOPTIONS that contain further options for codeline decoding.
Codeline
Pointer to the user buffer where codeline will be copied.
Length
Pointer to a variable that in input specify the size of the user buffer pointed by Codeline
parameter, in output will contain the number of character returned.

Return Value
LS100_OKAY
LS100_NO_LIBRARY_LOAD
LS100_INVALID_TYPE_CMD
LS100_EXECCMD
LS100_CMDSEQUENCEERROR
LS100_INVALID_CODELINE_TYPE
LS100_UNIT_PARAM
LS100_MISSING_IMAGE
LS100_INVALID_SIZEH_VALUE
LS100_OPEN_NOT_DONE

LS100_DECODE_FONT_NOT_PRESENT
LS100_DECODE_INVALID_COORDINATE
LS100_DECODE_INVALID_OPTION
LS100_DECODE_INVALID_CODELINE_TYPE
LS100_DECODE_SYSTEM_ERROR
LS100_DECODE_DATA_TRUNC
LS100_DECODE_INVALID_BITMAP
LS100_DECODE_ILLEGAL_USE

Comments

Description structur READOPTIONS:


typedef struct _ReadOption
{
BOOL PutBlanks; // TRUE or FALSE
char TypeRead; // Possible value 'M', 'N' or 'X'
}READOPTIONS, *LPREADOPTIONS;

PutBanks if equal at TRUE put a blank between diffent part of codeline, if FALSE no.
TypeRead for now accept only 'N'.

If the parameter CodelineType is set to READ_CODELINE_SW_OCRA the returned codeline starts with
the letter ‘A’.

If the parameter CodelineType is set to READ_CODELINE_SW_OCRB_NUM or


READ_CODELINE_SW_OCRB_ALFANUM the returned codeline starts with the letter ‘B’.

If the parameter CodelineType is set to READ_CODELINE_SW_E13B or


C.T.S. Electronics Page 30 of 83
LS100 Service Interface

READ_CODELINE_SW_E13B_X_OCRB the returned codeline starts with the letter ‘E’.

C.T.S. Electronics Page 31 of 83


LS100 Service Interface

3.15. LS100_ReadCodelineFromBitmap
#include "LS100.h"

Result API LS100_ReadCodelineFromBitmap( HWND hwnd,


CHAR Type_com,
HANDLE hImage,
char *CodelineType,
int Start_x,
int Start_y,
int sizeW,
int sizeH,
READOPTIONS *CodelineOpt,
LPSTR Codeline,
UINT *Length);

Description
This function allows to read a string of the types CodelineType from the document in all position of this.

Parameters
hwnd
Handle of the application windows which will receive the notification messages.
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)
hImage
Handle of the bitmap that contain the codeline to read.
CodelineType
Specify the type of codeline to read.
READ_CODELINE_SW_OCRA = read codeline from the position specified by X, Y and Size
parameters. The co-ordinate start from bottom left corner of the
document.
READ_CODELINE_SW_OCRB_NUM = read codeline from the position specified by X, Y and
Size parameters. The co-ordinate start from bottom left corner
of the document.
READ_CODELINE_SW_OCRB_ITALY = read codeline from the position specified by X, Y and
Size parameters. The co-ordinate start from bottom left corner
of the document.
READ_CODELINE_SW_OCRB_ALFANUM = read codeline from the position specified by X, Y
and Size parameters. The co-ordinate start from bottom left
corner of the document.
READ_CODELINE_SW_E13B = read codeline from the position specified by X, Y and Size
parameters. The co-ordinate start from bottom left corner of the
document.
Start_X
Specify the co-ordinate (in pixel) from left margin of the document.
Start_Y
Specify the y position (in pixel) of the codeline from bottom margin of the document.
SizeW
Specify the size (in pixel) of the codeline contained in the bitmap.
SizeH
C.T.S. Electronics Page 32 of 83
LS100 Service Interface

For the moment accept only the value MAX_PIXEL_HEIGHT.


CodelineOpt
Pointer to structure READOPTIONS that contain further options for codeline decoding.
Codeline
Pointer to the user buffer where codeline will be copied.
Length
Pointer to a variable that in input specify the size of the user buffer pointed by Codeline
parameter, in output will contain the number of character returned.

Return Value
LS100_OKAY
LS100_NO_LIBRARY_LOAD
LS100_INVALID_TYPE_CMD
LS100_EXECCMD
LS100_CMDSEQUENCEERROR
LS100_INVALID_CODELINE_TYPE
LS100_UNIT_PARAM
LS100_MISSING_IMAGE
LS100_INVALID_SIZEH_VALUE
LS100_OPEN_NOT_DONE

LS100_DECODE_FONT_NOT_PRESENT
LS100_DECODE_INVALID_COORDINATE
LS100_DECODE_INVALID_OPTION
LS100_DECODE_INVALID_CODELINE_TYPE
LS100_DECODE_SYSTEM_ERROR
LS100_DECODE_DATA_TRUNC
LS100_DECODE_INVALID_BITMAP
LS100_DECODE_ILLEGAL_USE

Comments

Description structur READOPTIONS:


typedef struct _ReadOption
{
BOOL PutBlanks; // TRUE or FALSE
char TypeRead; // Possible value 'M', 'N' or 'X'
}READOPTIONS, *LPREADOPTIONS;

PutBanks if equal at TRUE put a blank between diffent part of codeline, if FALSE no.
TypeRead for now accept only 'N'.

If the parameter CodelineType is set to READ_CODELINE_SW_OCRA the returned codeline starts with
the letter ‘A’.

If the parameter CodelineType is set to READ_CODELINE_SW_OCRB_NUM or


READ_CODELINE_SW_OCRB_ALFANUM the returned codeline starts with the letter ‘B’.

If the parameter CodelineType is set to READ_CODELINE_SW_E13B or


READ_CODELINE_SW_E13B_X_OCRB the returned codeline starts with the letter ‘E’.

C.T.S. Electronics Page 33 of 83


LS100 Service Interface

3.16. LS100_ReadBarcodeFromBitmap
#include "LS100.h"

Result API LS100_ReadBarcodeFromBitmap(HWND hwnd,


CHAR Type_com,
HANDLE hImage,
char TypeBarcode,
int Start_x,
int Start_y,
int sizeW,
int sizeH,
LPSTR Codeline,
UINT *Length);

Description
This function allows to decode a barcode 2 of 5 from the document in all position of this.

Parameters
hwnd
Handle of the application windows which will receive the notification messages.
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)
hImage
Handle of the 16 grey tone at 200 dpi bitmap that contain the symbol to read.
Handle of the 256 grey tone at 200 dpi bitmap that contain the symbol to read.
TypeBarcode
Type of barcode supported :
READ_BARCODE_2_OF5 = read in optical mode a barcode 2 of 5.
READ_BARCODE_CODE39 = read in optical mode a barcode CODE39.
READ_BARCODE_CODE128 = read in optical mode a barcode CODE128.
Start_X
Specify the co-ordinate (in millimeter) from right margin of the document.
Start_Y
Specify the y position (in millimeter) of the codeline from bottom margin of the document.
SizeW
Specify the size (in millimeter) of the window in the bitmap contained the barcode.
SizeH
Specify the hight (in millimeter) of the window in the bitmap contained the barcode.
Codeline
Pointer to the user buffer where codeline will be copied.
Length
Pointer to a variable that in input specify the size of the user buffer pointed by Codeline
parameter, in output will contain the number of character returned.

Return Value
LS100_OKAY
LS100_NO_LIBRARY_LOAD
LS100_INVALID_TYPE_CMD
C.T.S. Electronics Page 34 of 83
LS100 Service Interface

LS100_EXECCMD
LS100_CMDSEQUENCEERROR
LS100_MISSING_IMAGE
LS100_INVALID_BARCODE_TYPE
LS100_INVALID_COORDINATE
LS100_OPEN_NOT_DONE

LS100_BARCODE_GENERIC_ERROR
LS100_BARCODE_NOT_DECODABLE
LS100_BARCODE_OPENFILE_ERROR
LS100_BARCODE_READBMP_ERROR
LS100_BARCODE_MEMORY_ERROR
LS100_BARCODE_START_NOTFOUND
LS100_BARCODE_STOP_NOTFOUND

Comments

C.T.S. Electronics Page 35 of 83


LS100 Service Interface

3.17. LS100_ReadPdf417FromBitmap
#include "LS100.h"

Result API LS100_ReadPdf417FromBitmap( HWND hwnd,


CHAR Type_com,
HANDLE hImage,
LPSTR Codeline,
UINT *Length,
CHAR *ErrorRate,
int Reserved1,
int Reserved2,
int Reserved3,
int Reserved4);

Description
This function allows to read symbol PDF417 from the document in all position of this.

Parameters
hwnd
Handle of the application windows which will receive the notification messages.
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)
Himage
Handle of the 16 grey tone at 200 dpi bitmap that contain the symbol to read.
Handle of the 256 grey tone at 200 dpi bitmap that contain the symbol to read.
Codeline
Pointer to the user buffer where barcode symbol will be copied.
Length
Pointer to a variable that will contain the effective size of the symbol read.
ErrorRate
It represents the number of error correction characters.
Reserved1
Reserved for future improvement, must be set NULL.
Reserved2
Reserved for future improvement, must be set NULL.
Reserved3
Reserved for future improvement, must be set NULL.
Reserved4
Reserved for future improvement, must be set NULL.

Return Value
LS100_OKAY
LS100_NO_LIBRARY_LOAD
LS100_INVALID_TYPE_CMD
LS100_EXECCMD
LS100_CMDSEQUENCEERROR
LS100_MISSING_IMAGE
LS100_OPEN_NOT_DONE
C.T.S. Electronics Page 36 of 83
LS100 Service Interface

LS100_PDF_NOT_DECODABLE
LS100_PDF_READBMP_ERROR
LS100_PDF_BITMAP_FORMAT_ERROR
LS100_PDF_MEMORY_ERROR
LS100_PDF_START_NOTFOUND
LS100_PDF_STOP_NOTFOUND
LS100_PDF_LEFTIND_ERROR
LS100_PDF_RIGHTIND_ERROR
LS100_PDF_OPENFILE_ERROR

Comments

C.T.S. Electronics Page 37 of 83


LS100 Service Interface

3.18. LS100_LoadString
#include "LS100.h"

Result API LS100_LoadString(HWND hwnd,


CHAR Type_com,
CHAR Format,
SHORT Length,
LPSTR String);

Description
Loads the invalidation string, which may be printed onto the BACK side of the document.

Parameters
hwnd
Handle of the application windows which will receive the notification messages.
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)
Format
Set the character style for the invalidation string,
FORMAT_NORMAL = Normal
FORMAT_BOLD = Bold
Length
Length of invalidation string
String
Invalidation string

Return Value
LS100_OKAY
LS100_SERVERSYSERR
LS100_USBERR
LS100_PERIFNOTFOUND
LS100_HARDERR
LS100_PERIFOFFON
LS100_BOURRAGE
LS100_INVALIDCMD

Comments
Function supported only from the peripheral LS100 with the back printer.

C.T.S. Electronics Page 38 of 83


LS100 Service Interface

3.19. LS100_LoadMultiString
#include "LS100.h"

Result API LS100_LoadMultiString( HWND hwnd,


CHAR Type_com,
short OffsetStr1,
char Reserved1,
LPSTR String1,
short  Length1,
short OffsetStr2,
char Reserved2,
LPSTR String2,
short  Length2,
short OffsetStr3,
char Reserved3,
LPSTR String3,
short  Length3);

Description
Loads the up to tree invalidation strings, which may be printed onto the FRONT side of the document
shift of one offset from the right border.

Parameters
hwnd
Handle of the application windows which will receive the notification messages.
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)
OffsetStr1
Offset in millimeter from the right border of the document to start the print of the string 1.
Reserved1
Reserved for future improvement, must be set NULL.
String1
Invalidation string 1.
Length1
Length of invalidation string 1.
OffsetStr2
Offset in millimeter from the right border of the document to start the print of the string 2.
Reserved2
Reserved for future improvement, must be set NULL.
String2
Invalidation string 2.
Length2
Length of invalidation string 2.
OffsetStr3
Offset in millimeter from the right border of the document to start the print of the string 3.
Reserved3
Reserved for future improvement, must be set NULL.
String3
Invalidation string 3.
C.T.S. Electronics Page 39 of 83
LS100 Service Interface

Length3
Length of invalidation string 3.

Return Value
LS100_OKAY
LS100_SERVERSYSERR
LS100_USBERR
LS100_PERIFNOTFOUND
LS100_HARDERR
LS100_PERIFOFFON
LS100_BOURRAGE
LS100_INVALIDCMD

Comments
Function supported only from the peripheral LS100 with the front printer.

C.T.S. Electronics Page 40 of 83


LS100 Service Interface

3.20. LS100_Reset
#include "LS100.h"

Result API LS100_Reset (HWND hwnd,


CHAR Type_com);

Description
Tests, whether the cause of the error of the previous command has been removed and resets the
peripheral.

Parameters
hwnd
Handle of the application windows which will receive the notification messages.
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)

Return Value
LS100_OKAY
LS100_SERVERSYSERR
LS100_USBERR
LS100_PERIFNOTFOUND
LS100_HARDERR
LS100_PERIFOFFON
LS100_BOURRAGE
LS100_INVALIDCMD

Comments
This function can be used only to reset peripheral error condition, but cannot be used to abort a non-
suspensive pending command.

C.T.S. Electronics Page 41 of 83


LS100 Service Interface

3.21. LS100_Wait
#include "LS100.h"

Result API LS100_Wait (HWND hwnd,


INT *ReplyCmd,
void *Reserved);

Description
Wait until the not-suspensive command has finished.

Parameters
Hwnd
Handle of the application windows which will receive the notification messages.
ReplyCmd
Reply code of the not-suspensive command.
Reserved
Reserved for future improvement, must be set NULL.

Return Value
LS100_OKAY
LS100_SERVERSYSERR
LS100_USBERR
LS100_PERIFNOTFOUND
LS100_HARDERR
LS100_PERIFOFFON
LS100_BOURRAGE
LS100_INVALIDCMD

Comments

C.T.S. Electronics Page 42 of 83


LS100 Service Interface

3.22. LS100_Test
#include "LS100.h"

Result API LS100_Test (HWND hwnd,


INT *ReplyCmd);

Description
Test if the not-suspensive command has finished.

Parameters
Hwnd
Handle of the application windows which will receive the notification messages.
ReplyCmd
Reply code of the not-suspensive command.

Return Value
LS100_OKAY
LS100_SERVERSYSERR
LS100_USBERR
LS100_PERIFNOTFOUND
LS100_HARDERR
LS100_PERIFOFFON
LS100_BOURRAGE
LS100_INVALIDCMD

Comments

C.T.S. Electronics Page 43 of 83


LS100 Service Interface

3.23. LS100_PeriphStatus
#include "LS100.h"

Result API LS100_PeriphStatus (HWND hwnd,


unsigned char *SenseKey,
unsigned char *SensorStatus);

Description
This function can be used by client to retrieve the peripheral sensor status.

Parameters
Hwnd
Handle of the application windows which will receive the notification messages.

SenseKey
Pointer to a byte variable that will contain the sense key status.
Possible value are :

Hex Description
0H No sense
2H Unit busy
3H Paper jam
4H Hardware error
5H Illegal request
6H Unit attention (document not present)
BH Aborted command

SensorStatus
Pointer to a four byte variable that will contain the sensor status, at the moment the last 3 bytes
was set to zero.
Possible value are :

SensorStatus[ byte 0 ]
Bit Description
0 Document present in the leafer
1 bit = 0 the value of the previous bit is not valid, bit = 1 yes
2 Document present in the bin
3 bit = 0 the value of the previous bit is not valid, bit = 1 yes
4 Photo MICR covered
5 n.u.
6 n.u.
7 Peripheral just ON

Return Value
LS100_OKAY
LS100_SERVERSYSERR
LS100_USBERR
LS100_PERIFNOTFOUND
LS100_HARDERR
LS100_PERIFOFFON
C.T.S. Electronics Page 44 of 83
LS100 Service Interface

LS100_BOURRAGE
LS100_CMDSEQUENCEERROR

Comments
More information about the sensor status can be found on the peripheral manual.

C.T.S. Electronics Page 45 of 83


LS100 Service Interface

3.24. LS100_DoubleLeafingSensibility
#include "LS100.h"

Result API LS100_DoubleLeafingSensibility (HWND hWnd,


unsigned char Level);

Description
The function change the Double Leafing Sensibility level in peripheral memory for the next processed
documents until an power off or another set.

Parameters
hWnd
Handle of the application windows which will receive the notification messages.
Level
The value accepted are the follows:
DOUBLE_LEAFING_LEVEL2 – -33% of the level of auto calibration (less sensibility).
DOUBLE_LEAFING_LEVEL3 – -17% of the level of auto calibration.
DOUBLE_LEAFING_DEFAULT – Level of auto calibration (more sensibility).
DOUBLE_LEAFING_DISABLE – Double Leafing sensor disabled.

Return Value
LS100_OKAY
LS100_USBERR
LS100_PERIFNOTFOUND
LS100_HARDERR
LS100_PERIFOFFON
LS100_INVALID_VALUE
LS100_INVALIDCMD

Comments

C.T.S. Electronics Page 46 of 83


LS100 Service Interface

3.25. LS100_HistoryCommand
#include "LS100.h"

Result API LS100_HistoryCommand( HWND hwnd,


short Cmd,
S_HISTORY *sHistory);

Description
Return a structure compiled with the historical data stored in the peripheral.

Parameters
Hwnd
Handle of the application windows which will receive the notification messages.
Cmd
This variable can have the follow value :
CMD_READ_HISTORY : Compile the structure give in input.
CMD_ERASE_HISTORY : Reset the historical data stored in the peripheral.
sHistory
Structure returned from the peripheral.

Return Value
LS100_OKAY
LS100_SERVERSYSERR
LS100_USBERR
LS100_PERIFNOTFOUND
LS100_CMDSEQUENCEERROR

Comments
Description of the S_HISTORY structure :

typedef struct _History


{
short Size; // Size of the struct
unsigned long doc_sorted; // Document sortered
unsigned long bourrage_feeder; // Jam in the feeder
unsigned long bourrage_micr; // Jam during the MICR reading
unsigned long doc_retain; // Nr. of document retained
unsigned long bourrage_exit; // Jam after the film
unsigned long doc_cmc7_err; // Nr. of document CMC7, read with error
unsigned long doc_e13b_err; // Nr. of document E13B, read with error
unsigned long time_peripheral_on; // Peripheral time life
unsigned long num_turn_on; // Nr. of power on
unsigned long doc_ink_jet; // Nr. of document printed
unsigned long doc_stamp; // Nr. of document stamped

} S_HISTORY, *LPS_HISTORY;

C.T.S. Electronics Page 47 of 83


LS100 Service Interface

4. Image manipulation functions


This functions allow the image processing.

The following functions are a part of an optional module that is not included on the standard distribution
software kit.
LS100_SaveJPEG
LS100_SaveDIB
LS100_SaveTIFF
LS100_DisplayImage
LS100_UpdateImage
To use this function, you must have a complete software distribution kit.
If you try to use this function without the additional module the return value is LS100_NO_LIBRARY_LOAD.

C.T.S. Electronics Page 48 of 83


LS100 Service Interface

4.1. LS100_SaveJPEG
#include "LS100.h"

Result API LS100_SaveJPEG( HWND hwnd,


CHAR Type_com,
HANDLE hImage,
int quality,
LPSTR filename );

Description
This function allows to save the read image in JPEG format.

Parameters
Hwnd
Handle of the application windows which will receive the notification messages.
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)
hImage
Handle of the image to save in JPEG format.
Quality
Integer from 2 to 255 that indicates the relationship between quality and compression :
2 = max quality
255 = max compression.
Filename
Name of the file where the image will be saved.

Return Value
LS100_OKAY
LS100_NO_LIBRARY_LOAD
LS100_INVALID_QUALITY
LS100_MISSING_IMAGE

Comments
To use this function is necessary to install an additional module available with the complete software
distribution kit. If you try to use this function without the additional module the return value is
LS100_NO_LIBRARY_LOAD.

C.T.S. Electronics Page 49 of 83


LS100 Service Interface

4.2. LS100_SaveDIB
#include "LS100.h"

Result API LS100_SaveDIB( HWND hwnd,


CHAR Type_com,
HANDLE hImage,
LPSTR filename );

Description
This function allows to save the read image in Bitmap format.

Parameters
Hwnd
Handle of the application windows which will receive the notification messages.
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)
hImage
Handle of the image to save in BMP format.
Filename
Name of the file where the image will be saved.

Return Value
LS100_OKAY
LS100_BMP_ERROR
LS100_INVALCMD

Comments

C.T.S. Electronics Page 50 of 83


LS100 Service Interface

4.3. LS100_SaveTIFF
#include "LS100.h"

Result API LS100_SaveTIFF(HWND hwnd,


CHAR Type_com,
HANDLE hImage,
LPSTR filename,
int Type,
int SaveMode,
int PageNumber );

Description
This function allows to save the read image in TIFF format.

Parameters
Hwnd
Handle of the application windows which will receive the notification messages.
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)
hImage
Handle of the image to save in TIFF format.
Filename
Name of the file where the image will be saved.
Type
FILE_TIF = Tagged Image File Format
FILE_CCITT = TIFF CCITT only b/w image
FILE_CCITT_GROUP3_1DIM = CCITT Group3 one dimension only b/w image
FILE_CCITT_GROUP3_2DIM = CCITT Group3 two dimensions only b/w image
FILE_CCITT_GROUP4 = CCITT Group4 two dimensions only b/w image.
SaveMode
SAVE_OVERWRITE = Overwrite the file.
SAVE_APPEND = Append the image in a multi-page file images.
SAVE_REPLACE = Replace a image in a multi-page file images.
SAVE_INSERT = Insert the image in a multi-page file images.
PageNumber
Number of the position in a multi-page file.

Return Value
LS100_OKAY
LS100_TIFFERROR
LS100_MISSING_IMAGE
LS100_INVALID_TYPE
LS100_INVALID_SAVEMODE
LS100_INVALID_PAGE_NUMBER

Comments

C.T.S. Electronics Page 51 of 83


LS100 Service Interface

4.4. LS100_RotateImage
#include "LS100.h"

Result API LS100_RotateImage( HWND hWnd,


CHAR Type_com,
HANDLE hImage,
int degree,
HANDLE *hImageRotate);

Description
The function returns a copy of the given image rotated. Freeing one will not affect the other.

Parameters
hWnd
Handle of the application windows which will receive the notification messages.
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)
hImage
Handle of the image returned from LS100_ReadImage().
degree
Number of degrees to rotate (+/-). This can be a number from 1 to 36000. A positive value will
rotate the image in a clockwise rotation, while a negative value will rotate the image in a counter-
clockwise rotation.
hImageRotate
Pointer to a handle where will be returned the handle of the memory buffer containing the image
rotated in DIB format.

Return Value
LS100_OKAY
LS100_NO_LIBRARY_LOAD
LS100_INVALID_TYPE_COMMAND
LS100_EXECCMD
LS100_CMDSEQUENCEERROR
LS100_INVALID_DEGREE
LS100_MISSING_IMAGE
LS100_OPEN_NOT_DONE
LS100_R0TATE_ERROR

Comments
The images must be free with the function LS100_FreeImage().

C.T.S. Electronics Page 52 of 83


LS100 Service Interface

4.5. LS100_ImageBrightness
#include "LS100.h"

Result API LS100_ImageBrightness(HWND hWnd,


CHAR Type_com,
HANDLE hImage,
int nChange,
HANDLE *hNewImage);

Description
The function changes the intensity (brightness) of the image in a bitmap, it returns a copy of the given
image.

Parameters
hWnd
Handle of the application windows which will receive the notification messages.
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)
hImage
Handle of the image returned from LS100_ReadImage().
nChange
Amount to change the intensity. The intensity ranges from -1000 to 1000. A positive value
increases (or lightens) the brightness of the bitmap image. A negative values decreases (or
darkens) the brightness of the bitmap image.
hNewImage
Pointer to a handle where will be returned the handle of the memory buffer containing the image
modified in DIB format.

Return Value
LS100_OKAY
LS100_NO_LIBRARY_LOAD
LS100_INVALID_TYPE_COMMAND
LS100_EXECCMD
LS100_CMDSEQUENCEERROR
LS100_INVALID_NCHANGE
LS100_MISSING_IMAGE
LS100_OPEN_NOT_DONE
LS100_BRIGHTNESS_ERROR

Comments
The images must be free with the function LS100_FreeImage().

C.T.S. Electronics Page 53 of 83


LS100 Service Interface

4.6. LS100_ImageContrast
#include "LS100.h"

Result API LS100_ImageContrast(HWND hWnd,


CHAR Type_com,
HANDLE hImage,
int nChange,
HANDLE *hNewImage);

Description
The function increases or decreases the contrast of the image in a bitmap, it return a copy of the given
image.

Parameters
hWnd
Handle of the application windows which will receive the notification messages.
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)
hImage
Handle of the image returned from LS100_ReadImage().
nChange
Amount of contrast change. The contrast ranges from -1000 to 1000. A positive value increases
(or lightens) the brightness of the bitmap image. A negative values decreases (or darkens) the
brightness of the bitmap image.
hNewImage
Pointer to a handle where will be returned the handle of the memory buffer containing the image
modified in DIB format.

Return Value
LS100_OKAY
LS100_NO_LIBRARY_LOAD
LS100_INVALID_TYPE_COMMAND
LS100_EXECCMD
LS100_CMDSEQUENCEERROR
LS100_INVALID_NCHANGE
LS100_MISSING_IMAGE
LS100_OPEN_NOT_DONE
LS100_CONTRAST_ERROR

Comments
The images must be free with the function LS100_FreeImage().

C.T.S. Electronics Page 54 of 83


LS100 Service Interface

4.7. LS100_CutImage
#include "LS100.h"

Result API LS100_CutImage( HWND hWnd,


CHAR Type_com,
HANDLE hImage,
short UnitMeasure,
float Start_x,
float Start_y,
float sizeW,
float sizeW,
HANDLE *hNewImage);

Description
The function return a portion of the given image according to the rectangle provided.

Parameters
hWnd
Handle of the application windows which will receive the notification messages.
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)
hImage
Handle of the image returned from LS100_ReadImage().
UnitMeasure
Specify if the Start_X, Start_Y and SizeW measures are give in millimeter or in inch.
The values are UNIT_MM and UNIT_INCH.
Start_X
Specify the x co-ordinate from right margin of the document.
Start_Y
Specify the y co-ordinate from bottom margin of the document.
SizeW
Specify the width of the window to be cut in the document bitmap.
SizeH
Specify the height of the window to be cut in the document bitmap.
hNewImage
Pointer to a handle where will be returned the handle of the memory buffer containing the portion
of the image in DIB format.

Return Value
LS100_OKAY
LS100_NO_LIBRARY_LOAD
LS100_INVALID_TYPE_COMMAND
LS100_EXECCMD
LS100_CMDSEQUENCEERROR
LS100_UNIT_PARAM
LS100_MISSING_IMAGE
LS100_INVALID_COORDINATE
LS100_OPEN_NOT_DONE
C.T.S. Electronics Page 55 of 83
LS100 Service Interface

Comments
The images was free with the function LS100_FreeImage().

C.T.S. Electronics Page 56 of 83


LS100 Service Interface

4.8. LS100_ConvertImageToBW
#include "LS100.h"

Result API LS100_ConvertImageToBW (HWND hwnd,


CHAR Type_com,
SHORT Method,
HANDLE GrayImage,
LPHANDLE BwImage);

Description
This function can be used by client application to convert image from 256 grey tone to black and white.

Parameters
Hwnd
Handle of the application windows which will receive the notification messages.
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)
Method
Allow selection between different conversion algorithm:
ALGORITHM_NODITHERING : Use nearest color matching.
ALGORITHM_FLOYDSTEINDITHERING : Use Floyd-Steinberg dithering.
ALGORITHM_STUCKIDITHERING : Use Stucki dithering.
ALGORITHM_BURKESDITHERING : Use Burkes dithering.
ALGORITHM_SIERRADITHERING : Use Sierra dithering.
ALGORITHM_STEVENSONARCEDITHERING : Use Stevenson Arce dithering.
ALGORITHM_JARVISDITHERING : Use Jarvis dithering.
GrayImage
Handle of memory buffer containing an image, in DIB format, supplied by client for conversion.
The handle of the converted image will be returned into BwImage.
BwImage
Pointer to a handle where will be returned the handle of memory buffer containing b/w image of
the document in DIB format.

Return Value
LS100_OKAY
LS100_EXECCMD
LS100_CMDSEQUENCEERROR
LS100_NO_LIBRARY_LOAD
LS100_INVALID_METHOD
LS100_OPEN_NOT_DONE

Comments
This function can be used by client application to convert a 256 grey tone image to black and white
image. The grey scale image (in DIB format) to be converted must be supplied by the application. The
BW image returned from this function must be released by the application with the
LS100FreeImage() function. This function can be used only after LS100_Open has been correctly
executed.
C.T.S. Electronics Page 57 of 83
LS100 Service Interface

4.9. LS100_ConvertImageToBWEx
#include "LS100.h"

Result API LS100_ConvertImageToBWEx(HWND hWnd,


char Type_com,
short Method,
HANDLE GrayImage,
LPHANDLE BwImage,
short PoloFilter,
float Reserved);

Description
This function can be used by client application to convert image from 256 grey tone to black and white.
It is same at the function LS100_ConvertToBW, but support also new algorithm.
The CTS algorithm works also at 16 grey tone.

Parameters
hWnd
Handle of the application windows which will receive the notification messages.
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)
Method
Allow selection between different conversion algorithm:
ALGORITHM_CTS : Use a proprietary algorithm.
ALGORITHM_CTS_2 : Use a proprietary algorithm.
ALGORITHM_NODITHERING : Use nearest color matching.
ALGORITHM_FLOYDSTEINDITHERING : Use Floyd-Steinberg dithering.
ALGORITHM_STUCKIDITHERING : Use Stucki dithering.
ALGORITHM_BURKESDITHERING : Use Burkes dithering.
ALGORITHM_SIERRADITHERING : Use Sierra dithering.
ALGORITHM_STEVENSONARCEDITHERING : Use Stevenson Arce dithering.
ALGORITHM_JARVISDITHERING : Use Jarvis dithering.
GrayImage
Handle of memory buffer containing an image, in DIB format, supplied by client for conversion.
The handle of the converted image will be returned into BwImage.
BwImage
Pointer to a handle where will be returned the handle of memory buffer containing b/w image of
the document in DIB format.
PoloFilter
This parameter is used only if CTS algorithm is used, the valid range is from 50 to 600, the
default is 450 (DEFAULT_POLO_FILTER).
For the documents with a background clear the value must be low, for the documents with the
background darkness the value must be higth.
Reserved
Reserved for future improvement, must be set NULL.

Return Value
LS100_OKAY
C.T.S. Electronics Page 58 of 83
LS100 Service Interface

LS100_EXECCMD
LS100_CMDSEQUENCEERROR
LS100_NO_LIBRARY_LOAD
LS100_INVALID_METHOD
LS100_INVALID_POLO_FILTER
LS100_OPEN_NOT_DONE

Comments
This function can be used by client application to convert a 256 grey tone image to black and white
image. The grey scale image (in DIB format) to be converted must be supplied by the application. The
BW image returned from this function must be released by the application with the
LS100FreeImage() function. This function can be used only after LS100_Open has been correctly
executed.

C.T.S. Electronics Page 59 of 83


LS100 Service Interface

4.10. LS100_ConvertImage200To100dpi
#include "LS100.h"

Result API LS100_ConvertImage200To100dpi(HWND hWnd,


char Type_com,
HANDLE hImage,
LPHANDLE pImage);

Description
Convert a 16 grey, 256 grey or color image from 200 to 100 dpi.

Parameters
hWnd
Handle of the application windows which will receive the notification messages. (Reserved for
future use)
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)
hImage
Handle of memory buffer containing an image, in DIB format, supplied by client for conversion.
The handle of the converted image will be returned into pImage.
pImage
Pointer to a handle where will be returned the handle of memory buffer containing the converted
image of the document in DIB format.

Return Value
LS100_OKAY
LS100_SERVERSYSERR
LS100_INVALID_TYPE_CMD
LS100_EXECCMD
LS100_CMDSEQUENCEERROR
LS100_OPEN_NOT_DONE
LS100_MISSING_IMAGE
LS100_IMAGE_NOT_200_DPI

Comments
This function can be used by client application to convert a 200 dpi image to 100 dpi image. The grey or
color scale image (in DIB format) to be converted must be supplied by the application. The image
returned from this function must be released by the application. This function can be used only
after LS100_Open has been correctly executed.
The images was free with the function LS100_FreeImage().

C.T.S. Electronics Page 60 of 83


LS100 Service Interface

4.11. LS100_FreeImage
#include "LS100.h"

Result API LS100_FreeImage ( HWND hwnd,


LPHANDLE hImage);

Description
Free image memory returned from LS100_ReadImage(), LS100_ReadImagePiece(),
LS100_GetDocData(), LS100_ConvertImageToBW() and LS100_ConvertImageToBWEx().

Parameters
Hwnd
Handle of the application windows which will receive the notification messages.
hImage
Pointer to handle of image to be released.

Return Value
LS100_OKAY
LS100_INVALID_HANDLE

Comments
Use this function for release all the images area memory allocated by the library.

C.T.S. Electronics Page 61 of 83


LS100 Service Interface

4.12. LS100_DisplayImage
#include "LS100.h"

Result API LS100_DisplayImage (HWND hwnd,


HANDLE Hinstance
CHAR Type_com,
CHAR *FilenameFront,
CHAR *FilenameBack,
INT Xfront,
INT Yfront,
INT XBack,
INT YBack,
INT FrontWidth,
INT FrontHeight,
INT BackWidth,
INT BackHeight,
HWND *RetHwndFront,
HWND *RetHwndBack);

Description
This function display front and back images read from file.

Parameters
Hwnd
Handle of the application windows which will receive the notification messages.
HInstance
Handle of the application instance.
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)
FilenameFront
Pathname of the front image to display.
FilenameBack
Pathname of the back image to display.
Xfront
The x parameter is the initial x co-ordinate of the window's upper-left corner, in screen co-
ordinates of the front image.
Yfront
The Y parameter is the initial Y co-ordinate of the window's upper-left corner, in screen co-
ordinates of the front image.
Xback
The x parameter is the initial x co-ordinate of the window's upper-left corner, in screen co-
ordinates of the back image.
Yback
The Y parameter is the initial Y co-ordinate of the window's upper-left corner, in screen co-
ordinates of the back image.
FrontWidth
Width of front image.
FrontHeight
Height of front image.
C.T.S. Electronics Page 62 of 83
LS100 Service Interface

BackWidth
Width of back image.
BackHeight
Height of back image.
RetHwndFront
Handle of the new window that contain the front image.
RetHwndBack
Handle of the new window that contain the back image.

Return Value
LS100_OKAY
LS100_SERVERSYSERR
LS100_INVALIDCMD
LS100_NO_LIBRARY_LOAD
LS100_INVALID_HANDLE

Comments
To use this function is necessary to install an additional module available with the complete software
distribution kit. If you try to use this function without the additional module the return value is
LS100_NO_LIBRARY_LOAD

C.T.S. Electronics Page 63 of 83


LS100 Service Interface

4.13. LS100_UpdateImage
#include "LS100.h"

Result API LS100_UpdateImage (HWND hwnd,


CHAR Type_com,
CHAR *FilenameFront,
CHAR *FilenameBack,
HWND *RetHwndFront,
HWND *RetHwndBack);

Description
This function display front and back images read from file.

Parameters
Hwnd
Handle of the application windows which will receive the notification messages
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)
FilenameFront
Pathname of the front image to display.
FilenameBack
Pathname of the back image to display.
RetHwndFront
Handle of the window that contain the new front image.
RetHwndBack
Handle of the window that contain the new back image.

Return Value
LS100_OKAY
LS100_SERVERSYSERR
LS100_INVALIDCMD
LS100_NO_LIBRARY_LOAD
LS100_INVALID_HANDLE

Comments
This function can be used only after LS100_DisplayImage To use this function is necessary to install
an additional module available with the complete software distribution kit. If you try to use this
function without the additional module the return value is LS100_NO_LIBRARY_LOAD.

C.T.S. Electronics Page 64 of 83


LS100 Service Interface

5. Advanced document handling functions


This functions handle the documents in a loop. For each document it's possible to chose the resolution, read the
front or back image and codeline, print a validation string and save the image into file or into memory.

C.T.S. Electronics Page 65 of 83


LS100 Service Interface

5.1. LS100_AutoDocHandleEx
#include "LS100.h"

Result API LS100_AutoDocHandleEx(HWND hwnd,


CHAR Type_com,
SHORT FrontStamp,
SHORT Validate,
SHORT CodeLine,
SHORT ScanMode,
SHORT NumDocument,
SHORT ClearBlack,
CHAR Side,
SHORT SaveImage,
CHAR *DirectoryFile,
CHAR *BaseFilename,
float pos_x,
float pos_y,
float sizeW,
float sizeH,
int Quality,
SHORT FileFormat,
SHORT WaitTimeout,
short Beep,
int SaveMode,
int PageNumber,
short OriginMeasureDoc,
LPVOID Reserved1,
LPVOID Reserved2
LPVOID Reserved3);

Description
Execute a loop handling of document as specified by parameters values.

Parameters
Hwnd
Handle of the application windows which will receive the notification messages.
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)
FrontStamp
NO_FRONT_STAMP = do not execute front stamp
FRONT_STAMP = execute front stamp
Validate
NO_PRINT_VALIDATE = do not print validation string
PRINT_VALIDATE = print validation string
Codeline
Specify the type of codeline to read.
NO_READ_CODELINE = do not read codeline.
READ_CODELINE_MICR = read magnetic codeline CMC7 or E13B.
READ_BARCODE_PDF417 = read in optical mode a barcode PDF417.
C.T.S. Electronics Page 66 of 83
LS100 Service Interface

READ_BARCODE_2_OF5 = read in optical mode a barcode 2 of 5.


READ_CODELINE_SW_OCRA = read codeline from the position specified by X, Y and Size
parameters. The co-ordinate start from bottom right corner of the
document
READ_CODELINE_SW_OCRB_NUM = read codeline from the position specified by X, Y and
Size parameters. The co-ordinate start from bottom right corner
of the document.
READ_CODELINE_SW_OCRB_ITALY = read codeline from the position specified by X, Y and
Size parameters. The co-ordinate start from bottom left corner
of the document.
READ_CODELINE_SW_OCRB_ALFANUM = read codeline from the position specified by X, Y
and Size parameters. The co-ordinate start from bottom right
corner of the document.
READ_CODELINE_SW_E13B = read codeline from the position specified by X, Y and Size
parameters. The co-ordinate start from bottom right corner of the
document.
ScanMode
This parameter set the resolution for the image to read
SCAN_MODE_BW = 2 grey scale at 200 dpi
SCAN_MODE_BW_TIFF = Transfer the image from peripheral to PC in TIFF 2 mode (only for
the version RS_ )
SCAN_MODE_16GR100 = 16 grey scale at 100 dpi
SCAN_MODE_16GR200 = 16 grey scale at 200 dpi
SCAN_MODE_256GR100 = 256 grey scale at 100 dpi
SCAN_MODE_256GR200 = 256 grey scale at 200 dpi
SCAN_MODE_COLOR_100 = 24 bit color scale at 100 dpi
SCAN_MODE_COLOR_200 = 24 bit color scale at 200 dpi
SCAN_MODE_COLOR_AND_RED_100 = 24 bit color scale at 100 dpi and only red image
SCAN_MODE_COLOR_AND_RED_200 = 24 bit color scale at 200 dpi and only red image
NumDocument
This parameter set the maximum number of document to read.
0 = read all document present put in the feeder in a time of 6 second from one to other.
ClearBlack
Clear the black area of the image
NO_CLEAR_BLACK = no image cleaning, the black area is not removed.
CLEAR_ALL_BLACK = clean the document's image removing all the black around the image.
Side
Set the image to read
SIDE_FRONT_IMAGE = Read Front Image
SIDE_BACK_IMAGE = Read Back Image
SIDE_ALL_IMAGE = Read Both Images
SIDE_NONE_IMAGE = Do not read Image
SaveImage
Set how to save the image read
IMAGE_SAVE_ON_FILE = save on file the image
IMAGE_SAVE_HANDLE = save the image in memory
IMAGE_SAVE_BOTH = save the image in memory and in file
IMAGE_SAVE_NONE = do not save on file.
DirectoryFile
Directory where saving the image
BaseFilename
Base of the file name for image. For example if you set AA to this parameter the jpeg files
created will be AA0FF.jpg, for front image.
Start_X
Specify the x co-ordinates of the codeline. Reference point and unit of measure as of
OriginMeasureDoc parameter.
Start_Y
C.T.S. Electronics Page 67 of 83
LS100 Service Interface

Specify the y co-ordinates of the codeline, from the bottom margin of the document. Unit of
measure as of OriginMeasureDoc parameter.
SizeW
Specify the size of the window that contained codeline in the image. Unit of measure as of
OriginMeasureDoc parameter.
SizeH
Specify the height of the codeline.
For the moment accept only the value :
OCR_VALUE_IN_MM in case of measure in millimeter.
OCR_VALUE_IN_INCH in case of measure in inch.
Quality
Integer from 2 to 255 that indicates the relationship between quality and compression:
2 = max quality
255 = max compression.
FileFormat
This parameter set the file format for the document's images.
The only value allowed in this moment are :
SAVE_JPEG : save the image in a JPEG format file.
SAVE_BMP : save the image in a DIB format file.
FILE_TIF : save the image in a Tagged Image File Format file.
FILE_CCITT : save the image in a TIFF CCITT file.
FILE_CCITT_GROUP3_1DIM : save the image in a CCITT Group3 one dimension file.
FILE_CCITT_GROUP3_2DIM : save the image in a CCITT Group3 two dimensions file.
FILE_CCITT_GROUP4 : save the image in a CCITT Group4 two dimensions file.
WaitTimeout
This parameter allow to wait the peripheral timeout after the last document in the leafer.
WAIT_YES = wait the peripheral timeout
WAIT_NO = don't wait the peripheral timeout
Beep
Set the beep sound on the peripheral when an error occur
NO_BEEP : no beep is allowed
BEEP : beep is allowed
SaveMode
SAVE_OVERWRITE = Overwrite the file.
SAVE_APPEND = Append the image in a multi-page file images.
SAVE_REPLACE = Replace a image in a multi-page file images.
SAVE_INSERT = Insert the image in a multi-page file images.
PageNumber
Number of the position in a multi-page file.
OriginMeasureDoc
Corner of the document from start the measures, this parameter can value:
BOTTOM_LEFT_PIXEL = Measures express in pixel.
BOTTOM_RIGHT_MM = Measures express in millimeter.
BOTTOM_RIGHT_INCH = Measures express in inch.
Reserved1
Reserved for future use. Must be set to NULL.
Reserved2
Reserved for future use. Must be set to NULL.
Reserved3
Reserved for future use. Must be set to NULL.

Return Value
LS100_OKAY
LS100_SERVERSYSERR
LS100_USBERR
LS100_PERIFNOTFOUND
C.T.S. Electronics Page 68 of 83
LS100 Service Interface

LS100_HARDERR
LS100_RESERVERR
LS100_BOURRAGE
LS100_INVALIDCMD
LS100_DATALOST
LS100_EXECCMD
LS100_JPEGERROR

Comments
If the SaveImage parameter is set to IMAGE_SAVE_HANDLE or IMAGE_SAVE_BOTH, this function
allocate a memory image buffer for each document. After call this function the application must call the
LS100_GetDocData to retrieve the images handle, display the images and then release the memory
buffer. To print the validation string you must execute LS100_LoadString before call
LS100_AutoDocHandleEx.

C.T.S. Electronics Page 69 of 83


LS100 Service Interface

5.2. LS100_AutoDocHandle
#include "LS100.h"

Result API LS100_AutoDocHandle ( HWND hwnd,


CHAR Type_com,
SHORT FrontStamp,
SHORT Validate,
SHORT CodeLine,
SHORT ScanMode,
SHORT NumDocument,
SHORT ClearBlack,
CHAR Side,
SHORT SaveImage,
CHAR *DirectoryFile,
CHAR *BaseFilename,
int pos_x,
int pos_y,
int sizeW,
int sizeH,
int Quality,
SHORT FileFormat,
SHORT WaitTimeout,
short Beep,
int SaveMode,
int PageNumber,
short OriginMeasureDoc,
LPVOID Reserved2);

Description
Execute a loop handling of document as specified by parameters values.

Parameters
Hwnd
Handle of the application windows which will receive the notification messages.
Type_com
Execution mode of the command:
SUSPENSIVE_MODE = Synchronous mode
NOT_SUSPENSIVE_MODE = Asynchronous mode (use LS100_Wait command to wait until the
command completes or use LS100_Test to check command processing status)
FrontStamp
NO_FRONT_STAMP = do not execute front stamp
FRONT_STAMP = execute front stamp
Validate
NO_PRINT_VALIDATE = do not print validation string
PRINT_VALIDATE = print validation string
Codeline
Specify the type of codeline to read.
NO_READ_CODELINE = do not read codeline.
READ_CODELINE_MICR = read magnetic codeline CMC7 or E13B.
READ_BARCODE_PDF417 = read in optical mode a barcode PDF417.
READ_BARCODE_2_OF_5 = read in optical mode a barcode 2 of 5.
READ_CODELINE_SW_OCRA = read codeline from the position specified by X, Y and Size
C.T.S. Electronics Page 70 of 83
LS100 Service Interface

parameters. The co-ordinate start from bottom left corner of the


document.
READ_CODELINE_SW_OCRB_NUM = read codeline from the position specified by X, Y and
Size parameters. The co-ordinate start from bottom left corner
of the document.
READ_CODELINE_SW_OCRB_ITALY = read codeline from the position specified by X, Y and
Size parameters. The co-ordinate start from bottom left corner
of the document.
READ_CODELINE_SW_OCRB_ALFANUM = read codeline from the position specified by X, Y
and Size parameters. The co-ordinate start from bottom left
corner of the document.
READ_CODELINE_SW_E13B = read codeline from the position specified by X, Y and Size
parameters. The co-ordinate start from bottom left corner of the
document.
ScanMode
This parameter set the resolution for the image to read
SCAN_MODE_BW = 2 grey scale at 200 dpi
SCAN_MODE_BW_TIFF = Transfer the image from peripheral to PC in TIFF 2 mode (only for
the version RS_ )
SCAN_MODE_16GR100 = 16 grey scale at 100 dpi
SCAN_MODE_16GR200 = 16 grey scale at 200 dpi
SCAN_MODE_256GR100 = 256 grey scale at 100 dpi
SCAN_MODE_256GR200 = 256 grey scale at 200 dpi
SCAN_MODE_COLOR_100 = 24 bit color scale at 100 dpi
SCAN_MODE_COLOR_200 = 24 bit color scale at 200 dpi
SCAN_MODE_COLOR_AND_RED_100 = 24 bit color scale at 100 dpi and only red image
SCAN_MODE_COLOR_AND_RED_200 = 24 bit color scale at 200 dpi and only red image
NumDocument
This parameter set the maximum number of document to read.
0 = read all document present put in the feeder in a time of 6 second from one to other.
ClearBlack
Clear the black area of the image
NO_CLEAR_BLACK = no image cleaning, the black area is not removed.
CLEAR_ALL_BLACK = clean the document's image removing all the black around the image.
Side
Set the image to read
SIDE_FRONT_IMAGE = Read Front Image
SIDE_BACK_IMAGE = Read Back Image
SIDE_ALL_IMAGE = Read Both Images
SIDE_NONE_IMAGE = Do not read Image
SaveImage
Set how to save the image read
IMAGE_SAVE_ON_FILE = save on file the image
IMAGE_SAVE_HANDLE = save the image in memory
IMAGE_SAVE_BOTH = save the image in memory and in file
IMAGE_SAVE_NONE = do not save on file.
DirectoryFile
Directory where saving the image
BaseFilename
Base of the file name for image. For example if you set AA to this parameter the jpeg files
created will be AA0FF.jpg, for front image.
Start_X
Specify the co-ordinate (in pixel) from left or right margin of the document.
Start_Y
Specify the y position (in pixel) of the codeline from bottom margin of the document.
SizeW
Specify the size (in pixel) of the codeline contained in the bitmap.
C.T.S. Electronics Page 71 of 83
LS100 Service Interface

SizeH
For the moment accept only the value MAX_PIXEL_HEIGHT.
Quality
Integer from 2 to 255 that indicates the relationship between.
Quality and compression: 2 = max quality; 255 = max compression.
FileFormat
This parameter set the file format for the document's images.
The only value allowed in this moment are :
SAVE_JPEG : save the image in a JPEG format file.
SAVE_BMP : save the image in a DIB format file.
FILE_TIF : save the image in a Tagged Image File Format file.
FILE_CCITT : save the image in a TIFF CCITT file.
FILE_CCITT_GROUP3_1DIM : save the image in a CCITT Group3 one dimension file.
FILE_CCITT_GROUP3_2DIM : save the image in a CCITT Group3 two dimensions file.
FILE_CCITT_GROUP4 : save the image in a CCITT Group4 two dimensions file.
WaitTimeout
This parameter allow to wait the peripheral timeout after the last document in the leafer.
WAIT_YES = wait the peripheral timeout
WAIT_NO = don't wait the peripheral timeout
Beep
Set the beep sound on the peripheral when an error occur
NO_BEEP : no beep is allowed
BEEP : beep is allowed
SaveMode
SAVE_OVERWRITE = Overwrite the file.
SAVE_APPEND = Append the image in a multi-page file images.
SAVE_REPLACE = Replace a image in a multi-page file images.
SAVE_INSERT = Insert the image in a multi-page file images.
PageNumber
Number of the position in a multi-page file.
OriginMeasureDoc
Corner of the document from start the measures, this parameter can value:
BOTTOM_LEFT_PIXEL = Measures express in pixel.
BOTTOM_RIGHT_MM = Measures express in millimeter.
Reserved1
Reserved for future use. Must be set to NULL.

Return Value
LS100_OKAY
LS100_SERVERSYSERR
LS100_USBERR
LS100_PERIFNOTFOUND
LS100_HARDERR
LS100_RESERVERR
LS100_BOURRAGE
LS100_INVALIDCMD
LS100_DATALOST
LS100_EXECCMD
LS100_JPEGERROR

Comments
If the SaveImage parameter is set to IMAGE_SAVE_HANDLE or IMAGE_SAVE_BOTH, this function
allocate a memory image buffer for each document. After call this function the application must call the
LS100_GetDocData to retrieve the images handle, display the images and then release the memory
buffer. To print the validation string you must execute LS100_LoadString before call
C.T.S. Electronics Page 72 of 83
LS100 Service Interface

LS100_AutoDocHandle.

C.T.S. Electronics Page 73 of 83


LS100 Service Interface

5.3. LS100_GetDocData
#include "LS100.h"

Result API LS100_GetDocData (HWND hwnd,


CHAR Wait_com,
unsigned long *NrDoc,
LPSTR FilenameFront,
LPSTR FilenameBack,
LPSTR FilenameFrontNetto,
LPSTR FilenameBackNetto,
LPLONG *FrontImage,
LPLONG *Backmage,
LPLONG *FrontImageNetto,
LPLONG *BackmageNetto,
LPSTR CodelineSW,
LPSTR CodelineHW,
LPSTR Barcode,
LPVOID CodelinesOptical,
SHORT *DocToRead,
LONG *ErrorType,
LPVOID Reserved5,
LPVOID Reserved6);

Description
Obtain information about the documents read with the LS100_AutoDocHandle, if no document was
processed the function return LS100_NO_OTHER_DOCUMENT.

Parameters
Hwnd
Handle of the application windows which will receive the notification messages.
Wait_com
Execution mode of the command:
WAIT_YES = Suspensive mode.
WAIT_NO = Not suspensive mode (At the moment not yet implemented).
NrDoc
Return the number of the document processed.
FilenameFront
Name of the file where the front image is stored.
FilenameBack
Name of the file where the back image is stored.
FilenameFrontNetto
Name of the file where the front Netto image is stored.
FilenameBackNetto
Name of the file where the back Netto image is stored.
*FrontImage
Pointer to a long pointer where will be returned the handle of the front image memory stored by
the service.
*Backmage
Pointer to a long pointer where will be returned the handle of the back image memory stored by
the service.
*FrontImageNetto
Pointer to a long pointer where will be returned the handle of the front Netto image memory
C.T.S. Electronics Page 74 of 83
LS100 Service Interface

stored by the service.


*BackmageNetto
Pointer to a long pointer where will be returned the handle of the back Netto image memory
stored by the service.
CodelineSW
This string will contain the codeline software required.
CodelineHW
This sting will contain the hardware codeline.
Barcode
This sting will contain the barcode codeline PDF417 or barcode 2 of 5.
CodelinesOptical
This sting will contain the codelines optical (Not available at this moment).
*DocToRead
Number of document's information to retrieve by this function.
*ErrorType
Error associated at the data document returned (this feature must be implemented).
*Reserved5
Reserved for future use. Must be set to NULL.
*Reserved6
Reserved for future use. Must be set to NULL.

Return Value
LS100_OKAY
LS100_SERVERSYSERR
LS100_USBERR
LS100_PERIFNOTFOUND
LS100_HARDERR
LS100_PERIFOFFON
LS100_BOURRAGE
LS100_INVALIDCMD
LS100_DATATRUNC
LS100_DATALOST
LS100_NO_OTHER_DOCUMENT

Comments
The image handle retrieve by this function must be released by the application.
In case of more Optic Codelines its are separated by a blank.

C.T.S. Electronics Page 75 of 83


LS100 Service Interface

6. Debug and Download functions


This functions help the developer to debug your application, its can be call in the phase of develop and after
removed from the application code.

C.T.S. Electronics Page 76 of 83


LS100 Service Interface

6.1. LS100_ViewOCRRectangle
#include "LS100.h"

Result API LS100_ViewOCRRectangle( HWND hwnd,


BOOL fView );

Description
This function draw a red rectangle around the zone of the ORC decode done with the functions
LS100_CodelineReadFromBitmap() and LS100_ReadCodelineFromBitmap().

Parameters
hwnd
Handle of the application windows which will receive the notification messages.
fView
TRUE enable the draw of the rectangle.
FLASE disable the draw of the rectangle.

Return Value
LS100_OKAY
LS100_INVALID_IMAGE

Comments

C.T.S. Electronics Page 77 of 83


LS100 Service Interface

6.2. LS100_DownloadFirmware
#include "LS100.h"

Result API LS100_DownloadFirmware( HWND hwnd,


char *FileFw,
int (__stdcall *userfunc1)(char *Item) );

Description
The function send the new firmware at the peripheral, one item for time.

Parameters
Hwnd
Handle of the application windows which will receive the notification messages.
FileFw
Pathname complete of the file that contain the firmware to download.
(*userfunc1)(char *Item)
Address of a call-back function that return in Item the string send at the peripheral, this for
monitoring of that download from the application.
This parameter can be set NULL.

Return Value
LS100_OKAY
LS100_EXECCMD
LS100_CMDSEQUENCEERROR
LS100_MISSING_FILENAME
LS100_OPEN_NOT_DONE
LS100_OPEN_FILE_ERROR_OR_NOT_FOUND

Comments
The third parameter is exported only for permit at the application to trace the item send art the peripheral
or for increment a progress bar.

C.T.S. Electronics Page 78 of 83


LS100 Service Interface

7. Application Program Guideline

This is a brief description on how to use LS100 functions to develop an application program.
The logical flow of the command must be structured as in the following two sample:

1. Manual document handling :

LS100_Open /* Logical connection to the peripheral */


LS100_Identify /* Peripheral identification */
.....
LS100_ReadBadge /* Badge read */
.....
LS100_LoadString /* Load invalidation string */
LS100_DocHandle /* Execute physical document handling */
LS100_ReadCodeline /* Read document codeline data */
LS100_ReadImage /* Read document image */
LS100_Close /* Disconnect from peripheral/

2. Advanced document handling :

LS100_Open /* Logical connection to the peripheral */

LS100_Identify /* Peripheral identification */


.....
LS100_ReadBadge /* Badge read */
.....
LS100_LoadString /* Load invalidation string */
LS100_AutoDocHandle /* Execute automatic document handling */
LS100_GetDocData /* Retrieve the documents information */
LS100_Close /* Disconnect from peripheral */

3. Overlapped document handling :

LS100_Open /* Logical connection to the peripheral */

LS100_Identify /* Peripheral identification */


.....
LS100_ReadBadge /* Badge read */
.....
LS100_LoadString /* Load invalidation string */
LS100_DocHandleOverlapped /* Execute automatic document handling */
LS100_Close /* Disconnect from peripheral */

Note :

 LS100_Identify allows client to know specific peripheral equipment and capabilities.


 Document handling functions must be used only inside a document handling session.
 To release the image memory allocated by the service it's necessary to use LS100_FreeImage.
 To use LS100_ConvertImageToBW is necessary to do the manual document handling.
 To use LS100_SaveJpeg, LS100_DisplayImage, LS100_UpdateImage is necessary to install the

C.T.S. Electronics Page 79 of 83


LS100 Service Interface

complete software distribution kit.

ATTENTION :

When the application call LS100_Open, the service try to load the additional module IMG_UTIL.DLL.
If this module is not present the service disable the use of the additional function, but if present the following
additional dll are required :
LFBMP13N.DLL
LFCMP13N.DLL
LFFAX13N.DLL
LTDIS13N.DLL
LTDLG13N.DLL
LTFIL13N.DLL
LTIMG13N.DLL
LTKRN13N.DLL
LTEFX13N.DLL
otherwise the system display an "Unable to locate DLL" message box.

C.T.S. Electronics Page 80 of 83


LS100 Service Interface

8. Reply Codes
LS100 functions reply codes are coded as requested by environment standard and all the possible reply codes
are identified by a symbolic name as shown by the table below.

Class
Symbolic Name Description Possible Reasons

LS100_OKAY Command correctly


executed
LS100_SERVERSYSERR E The service was Memory allocation error
unable to execute
command due to a
system error
LS100_USBERR E The service was Error condition coming from
unable to execute USB Manager or USB
command due to a exchange data
USB error
LS100_PERIFNOTFOUND E Peripheral not found Peripheral is switched off or
by the service not connected to the USB
port
LS100_HARDERR E Peripheral hardware Peripheral hardware is not
error operating correctly
LS100_PERIFOFFON E Peripheral has been The peripheral has been
switched off and on switched off and on again
again between the last and the
current command.
LS100_RESERVERR E Peripheral Another program is using the
reservation error peripheral.
LS100_BOURRAGE E Document jammed Document jammed
LS100_INVALCMD E Invalid command The current command
contains invalid parameters
specification or is
inconsistent with the
previous command sequence
LS100_DATALOST E Error during codeline Application buffer not
data transfer sufficient for contained all
the character undecoded
LS100_EXECCMD E A command is Command refused because
already in execution other command has been
launched
LS100_CMDSEQUENCEERR E The command’s The command is executed in
OR sequence is not wrong sequence.
correct
C.T.S. Electronics Page 81 of 83
LS100 Service Interface

LS100_BARCODE_ERROR E Barcode string is in The barcode string cannot be


error. read.
LS100_INVALID_HANDLE E The handle is invalid The handle passed to image
manipulation function like
LS100ConvertImageToBW
is invalid.
LS100_NO_LIBRARY_LOAD E Library Install the complete software
IMG_UTIL.dll not distribution kit or verified
installed or not that the library
correctly installed IMG_UTIL.dll is present in
the same directory of the
library LS100.dll.
LS100_JPEGERROR E JPEG image not The current command is
created inconsistent with the
command sequence.
LS100_ALREADY_OPEN W The peripheral is Do LS100_Close, or use the
already connected other command.
LS100_STRINGTRUNCATED W Buffer insufficient Selected feeder (autofeeder
for contain the or scan feeder) is empty.
library release
LS100_FEEDEREMPTY W Feeder is empty Selected feeder (autofeeder
or scan feeder) is empty.
LS100_DATATRUNC W Data truncated Data transferred during
command execution has been
truncated because the
destination buffer was too
small.
LS100_DOUBLE_LEAFING W Document double More than one document has
feeding been feed by autofeeder.
LS100_DOCPRESENT W Document present You close or open a
document handling session
with a document already
present inside document
handling path.
LS100_NO_ENDCMD W Command not The not-suspensive
finished command is already in
execution
LS100_BADGETIMEOUT W Badge read timeout Timeout expired during read
badge.
LS100_NO_OTHER_DOCUM W There are not other The queue is empty and loop
ENT document handle is finished.
LS100_TRY_TO_RESET W Try to execute a The peripheral is in error
Reset command
LS100_NOSENSE W The peripheral is Re-execute the command
busy

C.T.S. Electronics Page 82 of 83


LS100 Service Interface

LS100_QUEUEFULL W The document’s To many documents is


queue is full. scanned.
LS100_RETRY W Retry the There are other documents in
GetDocData the queue.
command.

C.T.S. Electronics Page 83 of 83

You might also like