AddImageFileFromStream Method of the FRDocument Object

This method opens an image file from the input stream implemented by the user, and adds the pages corresponding to the opened file to the document. This method differs from the AddImageFileFromMemory method in that it can be used when the Engine object is created using the OutprocLoader object.



HRESULT AddImageFileFromStream(
  IReadStream*            Stream,
  IImagePasswordCallback* Callback,
  IPrepareImageMode*      PrepareMode,
  IIntsCollection*        PageIndices,
  BSTR                    FileName


void AddImageFileFromStream(
  IReadStream             Stream,
  IImagePasswordCallback  Callback,
  IPrepareImageMode       PrepareMode,
  IIntsCollection         PageIndices,
  string                  FileName

Visual Basic .NET

Sub AddImageFileFromStream( _
  Stream As IReadStream, _
  Callback As IImagePasswordCallback, _
  [PrepareMode As IPrepareImageMode = Nothing], _
  [PageIndices As IIntsCollection = Nothing], _
  [FileName As String = "0"] _


[in] Refers to the interface of the user-implemented object of the type IReadStream which contains the image file to be added to the document.
[in] This variable refers to the interface of the user-implemented object of the type ImagePasswordCallback which is used to handle possible password requests for accessing images in PDF format. This parameter is optional and may be 0, in which case password-protected files cannot be processed.
[in] Refers to the PrepareImageMode object which specifies how an image will be preprocessed during opening. This parameter is optional and may be 0, in which case either the default parameters are used, or, if a profile has been loaded, the parameters set by this profile are used.
[in] This parameter refers to the IntsCollection object which specifies the indices of the pages which have to be added to the document. This parameter is optional and may be 0, in which case all the pages of the opened file will be added to the document.
[in] Specifies the name of the image file. This information is used to define the format of the file, if not explicitly specified, and in error messages. This parameter is optional and may be 0. For opening the office formats, pass the name of the document with its extension.

Return values

This method has no specific return values. It returns the standard return values of ABBYY FineReader Engine functions.


  • When opening a PDF Portfolio file using this method, its cover is always included in the output file.
  • This method may report events to the listeners attached to the IConnectionPointContainer interface of the FRDocument object.
  • If your license includes the Office Formats Opening module, you may also use this method to open digital documents of supported formats.
  • Depending on the value of the IEngine::MultiProcessingParams property, ABBYY FineReader Engine can distribute opening of multi-page documents to CPU cores.
  • This method does not support WIC-compatible files opening.

See also


24.03.2023 8:51:52

Usage of Cookies. In order to optimize the website functionality and improve your online experience ABBYY uses cookies. You agree to the usage of cookies when you continue using this site. Further details can be found in our Privacy Notice.