Professional Documents
Culture Documents
LS100 Service Interface
LS100 Service Interface
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
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
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.
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
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.
3. Basic functions
This functions are the base service routine to manage the peripheral.
3.1. LS100_Open
#include "LS100.h"
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
3.2. LS100_Close
#include "LS100.h"
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
3.3. LS100_GetVersion
#include "LS100.h"
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
3.4. LS100_Identify
#include "LS100.h"
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.
3.5. LS100_DocHandle
#include "LS100.h"
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
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.
3.6. LS100_DocHandleOverlapped
#include "LS100.h"
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
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.
3.7. LS100_DocHandleAndGetData
#include "LS100.h"
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
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.
3.8. LS100_SetThresholdClearBlack
#include "LS100.h"
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
3.9. LS100_ReadImage
#include "LS100.h"
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().
3.10. LS100_ReadImagePiece
#include "LS100.h"
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.
3.11. LS100_ReadBadge
#include "LS100.h"
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().
3.12. LS100_ReadBadgeWithTimeout
#include "LS100.h"
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
Comments
The traces string returned start with the character 't'.
For interrupt a LS100_ReadBadgeWithTimeout() pending call the function LS100_Reset().
3.13. LS100_ReadCodeline
#include "LS100.h"
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.
3.14. LS100_CodelineReadFromBitmap
#include "LS100.h"
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
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
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’.
3.15. LS100_ReadCodelineFromBitmap
#include "LS100.h"
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
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
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’.
3.16. LS100_ReadBarcodeFromBitmap
#include "LS100.h"
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
3.17. LS100_ReadPdf417FromBitmap
#include "LS100.h"
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
3.18. LS100_LoadString
#include "LS100.h"
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.
3.19. LS100_LoadMultiString
#include "LS100.h"
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.
3.20. LS100_Reset
#include "LS100.h"
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.
3.21. LS100_Wait
#include "LS100.h"
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
3.22. LS100_Test
#include "LS100.h"
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
3.23. LS100_PeriphStatus
#include "LS100.h"
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.
3.24. LS100_DoubleLeafingSensibility
#include "LS100.h"
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
3.25. LS100_HistoryCommand
#include "LS100.h"
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 :
} S_HISTORY, *LPS_HISTORY;
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.
4.1. LS100_SaveJPEG
#include "LS100.h"
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.
4.2. LS100_SaveDIB
#include "LS100.h"
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
4.3. LS100_SaveTIFF
#include "LS100.h"
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
4.4. LS100_RotateImage
#include "LS100.h"
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().
4.5. LS100_ImageBrightness
#include "LS100.h"
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().
4.6. LS100_ImageContrast
#include "LS100.h"
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().
4.7. LS100_CutImage
#include "LS100.h"
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().
4.8. LS100_ConvertImageToBW
#include "LS100.h"
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"
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.
4.10. LS100_ConvertImage200To100dpi
#include "LS100.h"
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().
4.11. LS100_FreeImage
#include "LS100.h"
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.
4.12. LS100_DisplayImage
#include "LS100.h"
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
4.13. LS100_UpdateImage
#include "LS100.h"
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.
5.1. LS100_AutoDocHandleEx
#include "LS100.h"
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
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.
5.2. LS100_AutoDocHandle
#include "LS100.h"
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
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.
5.3. LS100_GetDocData
#include "LS100.h"
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
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.
6.1. LS100_ViewOCRRectangle
#include "LS100.h"
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
6.2. LS100_DownloadFirmware
#include "LS100.h"
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.
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:
Note :
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.
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