Chinese Simplified (简体中文)

AddImageFile Method of the FRDocument Object

This method opens a specified image file and adds the pages corresponding to the opened file to a document.



HRESULT AddImageFile(
  BSTR               ImageFileName,
  IPrepareImageMode* PrepareMode,
  IIntsCollection*   PageIndices


void AddImageFile(
  string           ImageFileName,
  IPrepareImageMode PrepareMode,
  IIntsCollection   PageIndices

Visual Basic .NET

Sub AddImageFile( _
  ImageFileName As String, _
  [PrepareMode As IPrepareImageMode = Nothing], _
  [PageIndices As IIntsCollection = Nothing] _


[in] This variable contains a full path to the image file to open.
[in] This parameter refers to the PrepareImageMode object which specifies how an image will be preprocessed during opening.
[in] This parameter refers to the IntsCollection object which specifies the indices of the pages which have to be added to a 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.

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 sample illustrates how to abort adding a page into document in case of its prolonged operating.

C++ (COM) code

This method is used in EventsHandling code sample and Document Comparison demo tool.

See also





Working with Images

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.