This project is read-only.

Imprinter/Endorser Functionality

Apr 16, 2012 at 9:25 PM
Edited Apr 16, 2012 at 9:27 PM


I would like to print the document counter on each page after scan acquisition. I'm currently working with a scanner simulator (kodak i620) which support the printing capabilities.

The idea is to modify the cTwain.vb by adding within the Function StartAcquire a call to a new "Function SetPrinterIndex" like the following code: 

If ActiveProfile IsNot Nothing Then

                        'set the customDsData
                        If ActiveProfile.CustomDsData IsNot Nothing AndAlso ActiveProfile.CustomDsData <> String.Empty Then
                        End If

                        SetImageFileFormat(CType(ActiveProfile.ImageAcquireFormat, Enumerations.ImageFileFormat))
                        'RR- PrinterIndex 



 Public Function SetPrinterIndex(ByVal value As Int32) As Boolean
        '//-----alias the namespace for shorter calls (not needed, just prettier)
        Dim cap_pri As Enumerations.Capability = Enumerations.Capability.Cap_PrinterIndex
        '//----- prep the container
        Dim PrinterIndexOneval As New DataStructures.twOneValue
        PrinterIndexOneval.ItemType = DataStructures.twCapability.CapType(cap_pri)
        PrinterIndexOneval.Item = value
        '//----- create the CapStruc with the container
        Dim capPrinterIndex As New DataStructures.twCapability(cap_pri, PrinterIndexOneval)
        '//----- set the Cap
        Dim retBool As Boolean = OperationTriplets.Control.Capability.Set(capPrinterIndex)
        Return retBool
    End Function


The SetPrinterIndex(1) set the starting number to 1.

The acquisition is done via profile and I've create some profiles with the scanner twain driver setting. For each profile I've activated the printing functionality where I can set the number of digit of the counter, the position of the printing, ect. I can also set the starting number but it seems that the corresponding capability is not saved in the _ActiveProfile.CustomDsData.

This is the reason why I've created the SetPrinterIndex function to call at runtime.

When I run my program no error are returned so everything seems fine but unfortunately with the simulator I can't test it really. I'll have the chance to test it with a real i620 but I would like to anticipate the issues.

Do you think this will work with a real scanner? Do you think this is the "right" way to implement the printing? Anyone have experience with a Kodak scanner or similar?