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

# CreateObjectFromDocument Method of the ClassificationEngine Object

Creates a new [ClassificationObject](/fine-reader/engine/api-reference/classification-related-objects/classificationobject) on the basis of the first page of a document. The classification object contains all the data needed by the classifier. Note that its Description property will contain the name of the file from which the document was created. If that is not acceptable, change the description after the object is created.

You can then either classify the object by the call to the [Classify](/fine-reader/engine/api-reference/classification-related-objects/model/classify-method) method of the [Model](/fine-reader/engine/api-reference/classification-related-objects/model) object or use it when training a new classification model.

If you need to create a classification object for another of the document pages, or for an [FRPage](/fine-reader/engine/api-reference/document-related-objects/frpage) object which belongs to no document, use the [CreateObjectFromPage](/fine-reader/engine/api-reference/classification-related-objects/classificationengine/createobjectfrompage-method) method.

## Syntax

### C++

```csharp theme={null}
HRESULT CreateObjectFromDocument(
  IFRDocument*            Document,
  IClassificationObject** Result
);
```

### C\#

```csharp theme={null}
IClassificationObject CreateObjectFromDocument( IFRDocument Document );
```

### Visual Basic .NET

```csharp theme={null}
Function CreateObjectFromDocument(Document As IFRDocument) As IClassificationObject
```

## Parameters

Document

\[in] An [FRDocument](/fine-reader/engine/api-reference/document-related-objects/frdocument) object which will be used to extract the data relevant for classification. Note that if you are going to use the classification object with a classifier which uses text features ([CT\_Text](/fine-reader/engine/api-reference/enumerations/classifiertypeenum#ct_text), [CT\_Combined](/fine-reader/engine/api-reference/enumerations/classifiertypeenum#ct_combined)), the first page of the document should contain some recognized text.

Result

\[out, retval] A pointer to the IClassificationObject\* pointer variable that receives the interface pointer of the output [ClassificationObject](/fine-reader/engine/api-reference/classification-related-objects/classificationobject) object.

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

[ClassificationEngine](/fine-reader/engine/api-reference/classification-related-objects/classificationengine)

[CreateObjectFromPage](/fine-reader/engine/api-reference/classification-related-objects/classificationengine/createobjectfrompage-method)
