See Also Examples Applies To
Creates a new document identifier template from an image file. This function uses embedded color management (ICM).
Syntax
object.ADRCreateTemplateFromFileICM (sFilePath)
The ADRCreateTemplateFromFileICM syntax has these parts:
| Part | Description |
| object | Required. An object expression that evaluates to an object in the Applies To list. |
| sFilePath | Required. String. The path of the image from wich the new template will be created. If this parameter is empty, prompts the user to select a file. |
Returns
Long. Return . The created template ID if success else, -1 if fail. check the GetStat() function to get the reason on this result.
Category
Automatic Document Recognition Functions
Visual Basic Sample
How to create document templates and identify the one which have the closer similar content than an image file.
Dim nTemplateID1 As Long, nTemplateID2 As Long
Dim nCloserTemplate As Long
'We create the first template from an image
nTemplateID1 = Object.ADRCreateTemplateFromFileICM("template1.tif")
If nTemplateID1 = 0 Then
MsgBox "Can't create nTemplateID1 " + "Error number: " + str(Object.GetStat)
End If
'We create the second template from an other kind of image
nTemplateID2 = Object.ADRCreateTemplateFromFileICM("template2.tif")
If nTemplateID2 = 0 Then
MsgBox "Can't create nTemplateID2 " + "Error number: " + str(Object.GetStat)
End If
'Now, we will try to identify an image.
nCloserTemplate = Object.ADRGetCloserTemplateForFileICM("document.tif")
Select Case nCloserTemplate
Case nTemplateID1
MsgBox "This image seems to get best similar content as nTemplateID1. Relevance is: " + str(Object.ADRGetLastRelevance) + " %"
Case nTemplateID2
MsgBox "This image seems to get best similar content as nTemplateID2. Relevance is: " + str(Object.ADRGetLastRelevance) + " %"
End Select
'Release created templates from memory
Object.ADRDeleteTemplate (nTemplateID1)
Object.ADRDeleteTemplate (nTemplateID2)