I can not find an example on how to set the imprinting value we need to spray on each page of the document when it is scanned we use the following formula in our current application that I have been tasked to replace
YYJJJX99999 YYJJJ p999
where the first julian date is the scandate the X is fixed the 99999 is the document sequence for that day the Second Julian Date is the Date of Reciept and the last information is the page number. we use seperator sheets to increment the document number, I have that part figured out. the code I am using is as follows
Code: Select all
'Here we will scan in a 1bpp ccitt4 & 200 DPI from adf to multipage tif file
If IsNothing(Me.Unit) Then
MsgBox("Must Set Unit ID First", MsgBoxStyle.MsgBoxHelp)
Exit Sub
End If
If IsNothing(Me.DOR) Then
MsgBox("Must Set DOR First", MsgBoxStyle.MsgBoxHelp)
Exit Sub
End If
Dim nImageCount As Integer
Dim ImageID As Integer
Dim MultiPageID As Integer
Dim nTemplateSeperator As Long
Dim nCloserTemplate As Long
If OpenSelectedSource() Then
nImageCount = 0
oGdPictureImaging.TwainSetHideUI(CBool(chkHideUI.CheckState))
oGdPictureImaging.TwainSetIndicators(CBool(chkIndicator.CheckState))
oGdPictureImaging.TwainSetAutoFeed(True) 'Set AutoFeed Enabled
oGdPictureImaging.TwainSetAutoScan(True) 'To achieve the maximum scanning rate
oGdPictureImaging.TwainSetResolution(200)
oGdPictureImaging.TwainSetPixelType(TwainPixelType.TWPT_BW) 'Black & White
oGdPictureImaging.TwainSetBitDepth(1) ' 1 bpp
'First Aquire the Seperator Page
ImageID = oGdPictureImaging.TwainAcquireToGdPictureImage(Me.Handle)
nTemplateSeperator = oGdPictureImaging.ADRCreateTemplateFromGdPictureImage(ImageID)
Do
'Now start scanning the Document
ImageID = oGdPictureImaging.TwainAcquireToGdPictureImage(Me.Handle)
If ImageID <> 0 Then
'If We detect a seperator Page then Output the file and reset the pagecount
nCloserTemplate = oGdPictureImaging.ADRGetCloserTemplateForGdPictureImage(ImageID)
If nCloserTemplate = nTemplateSeperator And oGdPictureImaging.ADRGetLastConfidence >= 92 Then
'A Paper seperator was detected save the file
oGdPictureImaging.TiffCloseMultiPageFile(MultiPageID)
nImageCount = 0
Me.Sequence = Me.Sequence + 1
Else
nImageCount = nImageCount + 1
Call ApplyImageFilters(ImageID)
If chkPreview.CheckState = 1 Then Call DisplayImage(ImageID)
If nImageCount = 1 Then
MultiPageID = ImageID
If Directory.Exists(sDroppoint) Then
Else
Directory.CreateDirectory(sDroppoint)
End If
Call oGdPictureImaging.TiffSaveAsMultiPageFile(MultiPageID, sDroppoint & Me.ScanDate & "X" & Me.Sequence & "." & Me.Unit & ".tif", TiffCompression.TiffCompressionCCITT4)
Else
oGdPictureImaging.TiffAddToMultiPageFile(MultiPageID, ImageID)
oGdPictureImaging.ReleaseGdPictureImage(ImageID)
End If
End If
End If
Loop While oGdPictureImaging.TwainGetState > TwainStatus.TWAIN_SOURCE_ENABLED
oGdPictureImaging.TiffCloseMultiPageFile(MultiPageID)
oGdPictureImaging.TwainCloseSource()
MsgBox("Done !")
End If
Thanks