Values that specify the options that will be used when saving recognition results
to a file.
Syntax
Example
Visual Basic | Copy Code |
---|
Public Sub SaveResultOptionsPropertyExample()
RasterSupport.Unlock(Leadtools.RasterSupportType.Ocr, "TestKey")
Dim rasterDocument As RasterDocumentEngine
rasterDocument = RasterDocumentEngine.Instance
rasterDocument.Startup()
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
Requirements
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family
See Also