C#
VB
C++
The RecognizeResponse object provides options for the Leadtools.Services.Forms.ServiceContracts.IOcrService.Recognize operation.
[DataContractAttribute(Namespace="http://Leadtools.Services.Forms.DataContracts/2009/01", Name="RecognizeResponse")]public class RecognizeResponse
<DataContractAttribute(Namespace="http://Leadtools.Services.Forms.DataContracts/2009/01", Name="RecognizeResponse")>Public Class RecognizeResponse
[DataContractAttribute(Namespace="http://Leadtools.Services.Forms.DataContracts/2009/01", Name="RecognizeResponse")]public ref class RecognizeResponse
using Leadtools.Services;using Leadtools.Services.Forms.ServiceContracts;using Leadtools.Services.Forms.ServiceImplementations;//using Leadtools.Services.Forms.DataContractsExamples.localhost;public void DocumentConvertOptionsExample(){OcrServiceClient client = new OcrServiceClient();RawBinaryData sourceBinaryData = new RawBinaryData();sourceBinaryData.Data = File.ReadAllBytes(Path.Combine(LEAD_VARS.ImagesDir, "clean.tif"));// set the document convertion optionsDocumentConvertOptions convertOptions = new DocumentConvertOptions();convertOptions.Source = sourceBinaryData;convertOptions.Destination = null;convertOptions.Format = OcrDocumentFormatType.TextAnsi;convertOptions.FirstPageNumber = 1;convertOptions.LastPageNumber = 1;RecognizeRequest request = new RecognizeRequest();request.ConvertOptions = convertOptions;RecognizeResponse response = client.Recognize(request);if (response.Destination != null){if (response.Destination is RawBinaryData)File.WriteAllBytes(Path.Combine(LEAD_VARS.ImagesDir, "clean.txt"), (response.Destination as RawBinaryData).Data);}client.Close();}static class LEAD_VARS{public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";}
Imports Leadtools.ServicesImports Leadtools.Services.Forms.ServiceContractsImports Leadtools.Services.Forms.ServiceImplementations'using Leadtools.Services.Forms.DataContractsExamples.localhost;Public Sub DocumentConvertOptionsExample()Dim client As OcrServiceClient = New OcrServiceClient()Dim sourceBinaryData As RawBinaryData = New RawBinaryData()sourceBinaryData.Data = File.ReadAllBytes(Path.Combine(LEAD_VARS.ImagesDir, "clean.tif"))' set the document convertion optionsDim convertOptions As DocumentConvertOptions = New DocumentConvertOptions()convertOptions.Source = sourceBinaryDataconvertOptions.Destination = NothingconvertOptions.Format = OcrDocumentFormatType.TextAnsiconvertOptions.FirstPageNumber = 1convertOptions.LastPageNumber = 1Dim request As RecognizeRequest = New RecognizeRequest()request.ConvertOptions = convertOptionsDim response As RecognizeResponse = client.Recognize(request)If Not response.Destination Is Nothing ThenIf TypeOf response.Destination Is RawBinaryData ThenFile.WriteAllBytes(Path.Combine(LEAD_VARS.ImagesDir, "clean.txt"), (TryCast(response.Destination, RawBinaryData)).Data)End IfEnd Ifclient.Close()End SubPublic NotInheritable Class LEAD_VARSPublic Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"End Class
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
