←Select platform

Destination Property

Summary

A BinaryData object that represents the resulting document file from the Leadtools.Services.Forms.ServiceContracts.IOcrService.Recognize operation.

Syntax

C#
VB
C++
[DataMemberAttribute(Name="Destination", IsRequired=true)] 
public BinaryData Destination { get; set; } 
  
<DataMemberAttribute(Name="Destination", IsRequired=True)> 
Public Property Destination As Leadtools.Services.Datacontracts.BinaryData 
[DataMemberAttribute(Name="Destination", IsRequired=true)] 
public: 
property Leadtools.Services.Datacontracts.BinaryData^ Destination { 
   Leadtools.Services.Datacontracts.BinaryData^ get(); 
   void set (    Leadtools.Services.Datacontracts.BinaryData^ ); 
} 

Property Value

A Leadtools.Services.DataContracts.BinaryData object that represents the document file resulting from the Leadtools.Services.Forms.ServiceContracts.IOcrService.Recognize(leadtools.services.forms.datacontracts.recognizerequest) operation.

Remarks

This property is valid only when DocumentConvertOptions.Destination is null.

Example

C#
VB
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 options 
   DocumentConvertOptions 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.Services 
Imports Leadtools.Services.Forms.ServiceContracts 
Imports 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 options 
   Dim convertOptions As DocumentConvertOptions = New DocumentConvertOptions() 
 
   convertOptions.Source = sourceBinaryData 
   convertOptions.Destination = Nothing 
   convertOptions.Format = OcrDocumentFormatType.TextAnsi 
   convertOptions.FirstPageNumber = 1 
   convertOptions.LastPageNumber = 1 
 
   Dim request As RecognizeRequest = New RecognizeRequest() 
   request.ConvertOptions = convertOptions 
 
   Dim response As RecognizeResponse = client.Recognize(request) 
 
   If Not response.Destination Is Nothing Then 
      If TypeOf response.Destination Is RawBinaryData Then 
         File.WriteAllBytes(Path.Combine(LEAD_VARS.ImagesDir, "clean.txt"), (TryCast(response.Destination, RawBinaryData)).Data) 
      End If 
   End If 
 
   client.Close() 
End Sub 
 
Public NotInheritable Class LEAD_VARS 
   Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images" 
End Class 

Requirements

Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.