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

# IImagePasswordCallback Interface

This interface is to be implemented on the client-side. It contains a method which can return a password when it is needed to access the image file. Currently, only files in PDF format can be protected with passwords.

The sequence of usage for this interface is as follows:

1. The user of ABBYY FineReader Engine implements an object with the IImagePasswordCallback interface. For C++, this object should be derived from this interface and implement its raw\_GetPassword method. This object should also implement the methods of the IUnknown interface.
2. The user then passes a pointer to this object's interface into any of the [IFRDocument::AddImageFileWithPasswordCallback](/fine-reader/engine/api-reference/document-related-objects/frdocument/addimagefilewithpasswordcallback-method), [IEngine::GetNumberOfPagesInImageFile](/fine-reader/engine/api-reference/engine-object-iengine-interface/processing-methods/getnumberofpagesinimagefile-method), [IEngine::RecognizeImageFile](/fine-reader/engine/api-reference/engine-object-iengine-interface/processing-methods/recognizeimagefile-method) methods as one of input parameters. ABBYY FineReader Engine will call the GetPassword method of this object to get the password if necessary.

In the case when the user does not expect to deal with password-protected image files or does not want to handle password requests, the NULL pointer may be passed instead of the pointer to IImagePasswordCallback interface. The only disadvantage of this approach is that password-protected image files will not be opened with ABBYY FineReader Engine.

## Method

| Name                                                                                                             | Description           |
| ---------------------------------------------------------------------------------------------------------------- | --------------------- |
| [GetPassword](/fine-reader/engine/api-reference/image-related-objects/iimagepasswordcallback/getpassword-method) | Returns the password. |

## Input parameter

This object is passed as an input parameter to the following methods:

* [OpenImageFileFromMemory](/fine-reader/engine/api-reference/engine-object-iengine-interface/processing-methods/openimagefilefrommemory-method), [RecognizeImageFile](/fine-reader/engine/api-reference/engine-object-iengine-interface/processing-methods/recognizeimagefile-method), [GetNumberOfPagesInImageFile](/fine-reader/engine/api-reference/engine-object-iengine-interface/processing-methods/getnumberofpagesinimagefile-method), [IsPdfPortfolio](/fine-reader/engine/api-reference/engine-object-iengine-interface/processing-methods/ispdfportfolio-method), [IsPdfPortfolioFromStream](/fine-reader/engine/api-reference/engine-object-iengine-interface/processing-methods/ispdfportfoliofromstream-method), [IsPdfWithTextualContent](/fine-reader/engine/api-reference/engine-object-iengine-interface/processing-methods/ispdfwithtextualcontent-method), [IsPdfWithTextualContentFromStream](/fine-reader/engine/api-reference/engine-object-iengine-interface/processing-methods/ispdfwithtextualcontentfromstream-method), [InjectTextLayer](/fine-reader/engine/api-reference/engine-object-iengine-interface/processing-methods/injecttextlayer-method) methods of the [Engine](/fine-reader/engine/api-reference/engine-object-iengine-interface) object.
* [AddImageFileFromAttachment](/fine-reader/engine/api-reference/document-related-objects/frdocument/addimagefilefromattachment-method) and [AddImageFileWithPasswordCallback](/fine-reader/engine/api-reference/document-related-objects/frdocument/addimagefilewithpasswordcallback-method) methods of the [FRDocument](/fine-reader/engine/api-reference/document-related-objects/frdocument) object.

## Samples

The interface is used in the following code samples: [CommandLineInterface](/fine-reader/engine/guided-tour/samples#commandlineinterface) (Windows and Linux).

## Remarks

In Linux, this interface does not work if the Engine object is loaded as an out-of-process server.
