ImageGear for .NET
WriteDirectText(ImGearRecPage,String) Method
See Also  Example Send Feedback
ImageGear21.Recognition Assembly > ImageGear.Recognition Namespace > ImGearRecOutputManager Class > WriteDirectText Method : WriteDirectText(ImGearRecPage,String) Method




page
ImGearRecPage object with the valid recognition data to be saved.
file
File to save recognition data to.

Glossary Item Box

Writes the recognition data of the page to the file in the direct text format.

Syntax

 
Visual Basic
C#
Managed Extensions for C++
C++/CLI
 
 

Parameters

page
ImGearRecPage object with the valid recognition data to be saved.
file
File to save recognition data to.

Remarks

Use DirectTextFormatto get or set the output format. If file parameter specifies an existing file name, the text outputs are appended.

Example

C#Copy Code
using (FileStream content = new FileStream("test1.tif", FileMode.Open))
{
    ImGearPage igPage = ImGearFileFormats.LoadPage(content, 0);
    ImGearRecPage recPage = igRecognition.ImportPage((ImGearRasterPage)igPage);
    recPage.Image.Preprocess();
    recPage.Recognize();

    igRecognition.OutputManager.CodePage = "Windows ANSI";
    igRecognition.OutputManager.DirectTextFormat = ImGearRecDirectTextFormat.FormattedText;
    if (File.Exists("singlePage.TXT"))
    {
        File.Delete("singlePage.TXT");
    }
    igRecognition.OutputManager.WriteDirectText(recPage, "singlePage.TXT");
    recPage.Dispose();
}
Visual BasicCopy Code
Using content As New FileStream("test1.tif", FileMode.Open)
    Dim igPage As ImGearPage = ImGearFileFormats.LoadPage(content, 0)
    Dim recPage As ImGearRecPage = igRecognition.ImportPage(DirectCast(igPage, ImGearRasterPage))
    recPage.Image.Preprocess()
    recPage.Recognize()

    igRecognition.OutputManager.CodePage = "Windows ANSI"
    igRecognition.OutputManager.DirectTextFormat = ImGearRecDirectTextFormat.FormattedText
    If File.Exists("singlePage.TXT") Then
        File.Delete("singlePage.TXT")
    End If
    igRecognition.OutputManager.WriteDirectText(recPage, "singlePage.TXT")
    recPage.Dispose()
End Using

See Also

©2013. Accusoft Corporation. All Rights Reserved.