Leadtools.Document Deprecated as of v16. Refer to: Leadtools.Forms.Ocr | Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
RemoveItemFromUserDictionary Method
See Also  Example
Leadtools.Document Namespace > RasterDocumentEngine Class : RemoveItemFromUserDictionary Method



section
Name of the section from which the item should be deleted.
item
RasterDocumentUserDictionaryItem class containing the word to be deleted. (The string must be terminated with a double zero.)
section
Name of the section from which the item should be deleted.
item
RasterDocumentUserDictionaryItem class containing the word to be deleted. (The string must be terminated with a double zero.)
Removes the specified section item from the specified section in the user dictionary.

Syntax

Visual Basic (Declaration) 
Public Sub RemoveItemFromUserDictionary( _
   ByVal section As String, _
   ByVal item As RasterDocumentUserDictionaryItem _
) 
Visual Basic (Usage)Copy Code
Dim instance As RasterDocumentEngine
Dim section As String
Dim item As RasterDocumentUserDictionaryItem
 
instance.RemoveItemFromUserDictionary(section, item)
C# 
public void RemoveItemFromUserDictionary( 
   string section,
   RasterDocumentUserDictionaryItem item
)
C++/CLI 
public:
void RemoveItemFromUserDictionary( 
   String^ section,
   RasterDocumentUserDictionaryItem item
) 

Parameters

section
Name of the section from which the item should be deleted.
item
RasterDocumentUserDictionaryItem class containing the word to be deleted. (The string must be terminated with a double zero.)

Example

Visual BasicCopy Code
Public Sub RemoveItemFromUserDictionaryExample()
   ' Note that this is a sample key, which will not work in your toolkit
   RasterSupport.Unlock(Leadtools.RasterSupportType.Ocr, "TestKey")

   Dim rasterDocument As RasterDocumentEngine
   rasterDocument = RasterDocumentEngine.Instance
   rasterDocument.Startup()

   ''' ...
   ''' ...
   ''' ...

   Dim item As RasterDocumentUserDictionaryItem = RasterDocumentUserDictionaryItem.Empty
   item.Value = "Peabody"
   item.Attribute = RasterDocumentDictionaryAttribute.Literal

   rasterDocument.RemoveItemFromUserDictionary("cities", item)
   rasterDocument.SetUserDictionary("USERDIC1.DIC", "cities", False)

   rasterDocument.Shutdown()
End Sub
C#Copy Code
public void RemoveItemFromUserDictionaryExample() 

   // Note that this is a sample key, which will not work in your toolkit 
   RasterSupport.Unlock(RasterSupportType.Ocr, "TestKey"); 
   RasterDocumentEngine rasterDocument; 
   rasterDocument = RasterDocumentEngine.Instance; 
   rasterDocument.Startup(); 
 
   // ... 
   // ... 
   // ... 
 
   RasterDocumentUserDictionaryItem item = RasterDocumentUserDictionaryItem.Empty; 
   item.Value = "Peabody"; 
   item.Attribute = RasterDocumentDictionaryAttribute.Literal; 
 
   rasterDocument.RemoveItemFromUserDictionary("cities", item); 
   rasterDocument.SetUserDictionary("USERDIC1.DIC", "cities", false); 
 
   rasterDocument.Shutdown(); 
}

Remarks

When there are two userDictionaryItem items in the section with the same name, but with different attributes, the RasterDocumentUserDictionaryItem.Attribute property will determine the item to be deleted. Deleting the last user dictionary item from a section causes the section to be removed automatically from the User dictionary.
For more information, refer to Working with a Dictionary.

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family

See Also

The Leadtools.Document namespace is deprecated and no longer supported as of LEADTOOLS v16. For v16 and later, please refer to: Leadtools.Forms.Ocr. This documentation is retained for v15 and earlier informational use only.