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
SaveResultOptions Property
See Also  Example
Leadtools.Document Namespace > RasterDocumentEngine Class : SaveResultOptions Property



Values that specify the options that will be used when saving recognition results to a file.

Syntax

Visual Basic (Declaration) 
Public Property SaveResultOptions As RasterDocumentResultOptions
Visual Basic (Usage)Copy Code
Dim instance As RasterDocumentEngine
Dim value As RasterDocumentResultOptions
 
instance.SaveResultOptions = value
 
value = instance.SaveResultOptions
C# 
public RasterDocumentResultOptions SaveResultOptions {get; set;}
C++/CLI 
public:
property RasterDocumentResultOptions SaveResultOptions {
   RasterDocumentResultOptions get();
   void set (RasterDocumentResultOptions value);
}

Return Value

A RasterDocumentResultOptions structure that contains information about recognition results being saved.

Example

Visual BasicCopy Code
Public Sub SaveResultOptionsPropertyExample()
   ' 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

   Dim resOpts As RasterDocumentResultOptions = New Leadtools.Document.RasterDocumentResultOptions()

   rasterDocument.RecognitionDataFileName = LeadtoolsExamples.Common.ImagesPath.Path + "test.rdf"
   rasterDocument.SpellLanguageId = RasterDocumentLanguage.English

   rasterDocument.Recognize(0, 1, Nothing)
   resOpts = rasterDocument.SaveResultOptions

   resOpts.Format = RasterDocumentFormatType.RtfWord2000
   resOpts.FormatLevel = RasterDocumentFormatLevel.Full

   Dim docOpts As RasterDocumentOptions = resOpts.Document
   docOpts.PaperSizeMode = RasterDocumentSelector.Predefined
   docOpts.PaperType = RasterDocumentPaperType.A4
   docOpts.MarginsMode = RasterDocumentSelector.Auto
   docOpts.LanguageMode = RasterDocumentSelector.Auto
   docOpts.Language = RasterDocumentOptionsLanguage.EnglishUS
   resOpts.Document = docOpts

   rasterDocument.SaveResultOptions = resOpts
   rasterDocument.SaveResultsToFile(LeadtoolsExamples.Common.ImagesPath.Path + "test.doc")
   rasterDocument.Shutdown()
End Sub
C#Copy Code
public void SaveResultOptionsPropertyExample() 

   // Note that this is a sample key, which will not work in your toolkit 
   RasterSupport.Unlock(Leadtools.RasterSupportType.Ocr, "TestKey"); 
 
   RasterDocumentEngine rasterDocument; 
   rasterDocument = RasterDocumentEngine.Instance; 
   rasterDocument.Startup(); 
 
   // assume page is added, refer to AddPage example for more information 
 
   RasterDocumentResultOptions resOpts = new RasterDocumentResultOptions(); 
 
   rasterDocument.RecognitionDataFileName = LeadtoolsExamples.Common.ImagesPath.Path + "test.rdf"; 
   rasterDocument.SpellLanguageId = RasterDocumentLanguage.English; 
 
   rasterDocument.Recognize(0, 1, null); 
   resOpts = rasterDocument.SaveResultOptions; 
 
   resOpts.Format = RasterDocumentFormatType.RtfWord2000; 
   resOpts.FormatLevel = RasterDocumentFormatLevel.Full; 
 
   RasterDocumentOptions docOpts = resOpts.Document; 
   docOpts.PaperSizeMode = RasterDocumentSelector.Predefined; 
   docOpts.PaperType = RasterDocumentPaperType.A4; 
   docOpts.MarginsMode = RasterDocumentSelector.Auto; 
   docOpts.LanguageMode = RasterDocumentSelector.Auto; 
   docOpts.Language = RasterDocumentOptionsLanguage.EnglishUS; 
   resOpts.Document = docOpts; 
 
   rasterDocument.SaveResultOptions = resOpts; 
   rasterDocument.SaveResultsToFile(LeadtoolsExamples.Common.ImagesPath.Path + "test.doc"); 
   rasterDocument.Shutdown(); 
}

Remarks

The options will be used only when calling SaveResultsToFile.
For more information, refer to Working with Zones.
For more information, refer to Recognizing Document Pages.

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.