ImageGear .NET v24.12 - Updated
WriteDirectText(ImGearRecPage,String) Method
Example 




ImageGear24.Recognition Assembly > ImageGear.Recognition Namespace > ImGearRecOutputManager Class > WriteDirectText Method : WriteDirectText(ImGearRecPage,String) Method
ImGearRecPage object with the valid recognition data to be saved.
File to save recognition data to.
Writes the recognition data of the page to the file in the direct text format.
Syntax
'Declaration
 
Public Overloads Sub WriteDirectText( _
   ByVal page As ImGearRecPage, _
   ByVal file As String _
) 
'Usage
 
Dim instance As ImGearRecOutputManager
Dim page As ImGearRecPage
Dim file As String
 
instance.WriteDirectText(page, file)
public void WriteDirectText( 
   ImGearRecPage page,
   string file
)
public: void WriteDirectText( 
   ImGearRecPage* page,
   string* file
) 
public:
void WriteDirectText( 
   ImGearRecPage^ page,
   String^ file
) 

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
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();
}
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

Reference

ImGearRecOutputManager Class
ImGearRecOutputManager Members
Overload List