> ## 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.

# GetNumberOfPagesInImageFile Method of the Engine Object

This method returns the number of pages in an image file.

## Syntax

### C++

```cpp theme={null}
HRESULT GetNumberOfPagesInImageFile(
  BSTR                    ImageFilePath,
  IImagePasswordCallback* PasswordCallback,
  int*                    Result
);
```

### C\#

```csharp theme={null}
int GetNumberOfPagesInImageFile(
  string                 ImageFilePath,
  IImagePasswordCallback PasswordCallback
);
```

### Visual Basic .NET

```vb theme={null}
Function GetNumberOfPagesInImageFile( _
  ImageFilePath As String, _
  [PasswordCallback As IImagePasswordCallback = Nothing] _
) As Integer
```

## Parameters

ImageFilePath

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

PasswordCallback

\[in] This variable refers to the interface of the user-implemented object of the type [ImagePasswordCallback](/fine-reader/engine/api-reference/image-related-objects/iimagepasswordcallback) 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.

Result

\[out, retval] A pointer to int variable that receives the return value of this method.

## 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).

## See also

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

[IImagePasswordCallback](/fine-reader/engine/api-reference/image-related-objects/iimagepasswordcallback)
