Leadtools.Document Requires Document/Medical product license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.10.31
SaveResultsToMemory Method
See Also  Example
Leadtools.Document Namespace > RasterDocumentEngine Class : SaveResultsToMemory Method




Saves the results of the last recognition process to memory.

Syntax

Visual Basic (Declaration) 
Public Function SaveResultsToMemory() As String
Visual Basic (Usage)Copy Code
Dim instance As RasterDocumentEngine
Dim value As String
 
value = instance.SaveResultsToMemory()
C# 
public string SaveResultsToMemory()
Managed Extensions for C++ 
public: string* SaveResultsToMemory(); 
C++/CLI 
public:
String^ SaveResultsToMemory(); 

Return Value

String containing the results of the last recognition process to memory.

Example

Visual BasicCopy Code
Public Sub SaveResultsToMemoryExample()
   ' 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()
   'assume page is added, refer to AddPage example for more information

   rasterDocument.RecognitionDataFileName = "C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\test.rdf"
   rasterDocument.SpellLanguageId = RasterDocumentLanguage.English

   Try
      rasterDocument.Recognize(0, 1, Nothing)
      Dim recogText As String = rasterDocument.SaveResultsToMemory()

      MessageBox.Show("Recognition Result Size =" & recogText.Length)
      MessageBox.Show("Recognition Result = " & recogText)
   Catch ex As Exception
      MessageBox.Show(ex.Message)
   End Try

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

   //  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(); 
 
   // assume page is added, refer to AddPage example for more information 
 
   rasterDocument.RecognitionDataFileName = @"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\test.rdf"; 
   rasterDocument.SpellLanguageId = RasterDocumentLanguage.English; 
 
   try 
   { 
      rasterDocument.Recognize(0, 1, null); 
      string recogText = rasterDocument.SaveResultsToMemory(); 
 
      MessageBox.Show("Recognition Result Size =" + recogText.Length); 
      MessageBox.Show("Recognition Result = " + recogText); 
   } 
   catch (Exception ex) 
   { 
      MessageBox.Show(ex.Message); 
   } 
 
   rasterDocument.Shutdown(); 
}

Remarks

Saves the results of the last recognition process to memory.
Call this method after the recognition process is complete to save the results to memory.
To recognize a page(s), call RasterDocumentEngine.Recognize method.
To save the recognition results to a file, call SaveResultsToFile.
For more information, refer to Confidence Reporting.

For more information, refer to Recognizing Document Pages.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Leadtools.Documentrequires a Document or Medical toolkit license and unlock key. For more information, refer to: Raster Pro/Document/Medical Features