LEADTOOLS WCF OCR (Leadtools.Services.Forms.DataContracts assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.31
Destination Property
See Also 
Leadtools.Services.Forms.DataContracts Namespace > RecognizeResponse Class : Destination Property



The Destination Property is available in LEADTOOLS Document and Medical Imaging toolkits.

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

Syntax

Visual Basic (Declaration) 
<DataMemberAttribute(Name="Destination", IsRequired=True)>
Public Property Destination As BinaryData
Visual Basic (Usage)Copy Code
Dim instance As RecognizeResponse
Dim value As BinaryData
 
instance.Destination = value
 
value = instance.Destination
C# 
[DataMemberAttribute(Name="Destination", IsRequired=true)]
public BinaryData Destination {get; set;}
C++/CLI 
[DataMemberAttribute(Name="Destination", IsRequired=true)]
public:
property BinaryData^ Destination {
   BinaryData^ get();
   void set (    BinaryData^ value);
}

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.

Example

Visual BasicCopy Code
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
C#Copy Code
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";
}

Remarks

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

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7

See Also

Applications developed with LEADTOOLS WCF components require runtime licenses. Server licensing is required for applications on a server. For more information, refer to: Imaging Pro/Document/Medical Features