ImageGear .NET v25.2 - Updated
ImageGear.OCR Assembly / ImageGear.OCR Namespace / ImGearOCR Class / WriteDirectText Method / WriteDirectText(ImGearOCRPage,Stream) Method
ImGearOCRPage object with valid recognition data to be saved.
System.IO.Stream object to which the recognition data will be written.




In This Topic
    WriteDirectText(ImGearOCRPage,Stream) Method
    In This Topic
    Writes the recognition data of the page to the output stream in the one of text formats.
    Syntax
    'Declaration
     
    Public Overloads MustOverride Sub WriteDirectText( _
       ByVal page As ImGearOCRPage, _
       ByVal stream As Stream _
    ) 
    'Usage
     
    Dim instance As ImGearOCR
    Dim page As ImGearOCRPage
    Dim stream As Stream
     
    instance.WriteDirectText(page, stream)
    public abstract void WriteDirectText( 
       ImGearOCRPage page,
       Stream stream
    )
    public: abstract void WriteDirectText( 
       ImGearOCRPage* page,
       Stream* stream
    ) 
    public:
    abstract void WriteDirectText( 
       ImGearOCRPage^ page,
       Stream^ stream
    ) 

    Parameters

    page
    ImGearOCRPage object with valid recognition data to be saved.
    stream
    System.IO.Stream object to which the recognition data will be written.
    Exceptions
    ExceptionDescription
    Argument page or stream is null.
    Given stream does not support writting.
    Given page or parent of given page is disposed.
    Remarks

    Use ImGearOCRSettings.DirectTextFormatto get or set the output format.

    The new recognition data will be written starting at the current position of the stream. When this method returns, the current position will be at the end of the stream, so you will need to set the position accordingly if you plan to read the stream later.

    The following rules apply if the stream parameter contains existing data:

    • If the current position is at the beginning of the stream, the existing data will be overwritten. The stream will be truncated or expanded to fit the size of the new data precisely.
    • If the current position is at the end of the stream, the new data will be appended to the existing data. The stream will be expanded to contain both the old and new data.
    • If the position is in the middle of the stream, the existing data from the current position onward will be overwritten. The stream will be truncated or expanded to fit the size of the existing data up to the current position, plus the size of the new data, precisely.

    See Also