> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CreateFRDocumentFromImage Method of the Engine Object

This method opens image file and creates the [FRDocument](/fine-reader/engine/api-reference/document-related-objects/frdocument) object.

## Syntax

### C++

```csharp theme={null}
HRESULT CreateFRDocumentFromImage(
  BSTR               ImageFileName,
  IPrepareImageMode* PrepareMode,
  IFRDocument**      Result
);
```

### C\#

```csharp theme={null}
IFRDocument CreateFRDocumentFromImage(
  string           ImageFileName,
  IPrepareImageMode PrepareMode
);
```

### Visual Basic .NET

```csharp theme={null}
Function CreateFRDocumentFromImage( _
  ImageFileName As String, _
  PrepareMode As IPrepareImageMode, _
) As IFRDocument
```

## Parameters

ImageFileName

\[in] This variable contains a full path to the image file to open.

Example: Windows: C:\MyPictures\MyPic.bmp,  Linux: /opt/MyPictures/MyPic.bmp, macOS: /Users/user/Pictures/MyPic.bmp

PrepareMode

\[in] This parameter refers to the [PrepareImageMode](/fine-reader/engine/api-reference/image-related-objects/prepareimagemode) object which specifies how an image will be preprocessed during opening.

Result

\[out, retval] A pointer to IFRDocument\* pointer variable that receives the interface pointer of the resulting [FRDocument](/fine-reader/engine/api-reference/document-related-objects/frdocument) object. Must not be NULL.

## Return values

This method has no specific return values. It returns the [standard return values of ABBYY FineReader Engine functions](/fine-reader/engine/api-reference/return-codes).

## Remarks

For Linux and Windows, if your license includes the [Office Formats Opening](/fine-reader/engine/licensing/modules#officeformatsopening) module, you may also use this method to open digital documents of [supported formats](/fine-reader/engine/specifications/supported-digital-document-input-formats).

## See also

[Engine](/fine-reader/engine/api-reference/engine-object-iengine-interface)

[FRDocument](/fine-reader/engine/api-reference/document-related-objects/frdocument)

[CreateFRDocument](/fine-reader/engine/api-reference/engine-object-iengine-interface/creation-methods/createlessobjectgreater-methods)
