OCREngine Class Documentation

classOCREngine

Namespace:datalogics_interface

Detailed Description

Represents an OCR Engine and its configuration.

Create an OCREngine object once, and reuse it to convert multiple images to Form objects to avoid repeating the sometimes expensive initialization of the engine. The configuration of the engine can't be changed after it's created; if you need to do that, create another OCREngine object.

Constructor & Destructor Documentation

OCREngine

OCREngine()

Create an OCR engine with default parameters.

OCREngine

OCREngine(OCRParamsparams)

Parameters

params: OCRParams

the configuration to use

Create an OCR engine with a specified configuration.

~OCREngine

~OCREngine()

Member Function Documentation

get_available_languages

std::vector< OCRLanguage >get_available_languages()

Returns:

the list of languages supported, or null if that list can't be determined.

Get a list of languages this OCREngine can use.

is_language_available

boolis_language_available(OCRLanguagelanguage)

Parameters

language: OCRLanguage

the language to check

Returns:

true if the language is available, false otherwise

Query if a language for OCR is available for use.

place_text_under

std::unique_ptr< Form >place_text_under(Image &image)

Parameters

image: Image &

The image in which to recognize text.

Returns:

a Form element containing the image with text underneath.

Recognize text in the image, returning a form with the image and text underneath.

Run the image through an OCR engine. Creates a Form element containing the image, and additional text underneath. The Form element has a transformation matrix which makes it directly substitutable for the image in a Content stream.

This method may throw an exception if it can't find a font that will represent all the characters in a word. See the candidateFontNames on OCRParams to supply more fonts.

place_text_under

std::unique_ptr< Form >place_text_under(Image &image, Document &document)

Parameters

image: Image &

The image in which to recognize text.

document: Document &

Returns:

a Form element containing the image with text underneath.

Recognize text in the image within a destination document.

Run the image through an OCR engine. Creates a Form element containing the image, and additional text underneath. The Form element has a transformation matrix which makes it directly substitutable for the image in a Content stream.

This method may throw an exception if it can't find a font that will represent all the characters in a word. See the candidateFontNames on OCRParams to supply more fonts.

place_text_under

std::unique_ptr< Form >place_text_under(Image &image, Document &document, doubleresolution)

Parameters

image: Image &

The image in which to recognize text.

document: Document &
resolution: double

Returns:

a Form element containing the image with text underneath.

Recognize text with a known image resolution.

Run the image through an OCR engine. Creates a Form element containing the image, and additional text underneath. The Form element has a transformation matrix which makes it directly substitutable for the image in a Content stream.

This method may throw an exception if it can't find a font that will represent all the characters in a word. See the candidateFontNames on OCRParams to supply more fonts.

place_text_under

std::unique_ptr< Form >place_text_under(Image &image, Document &document, doubleresolution, OCRMissingFontStrategystrategy)

Parameters

image: Image &

The image in which to recognize text.

document: Document &
resolution: double

Returns:

a Form element containing the image with text underneath.

Recognize text with known resolution and missing font strategy.

Run the image through an OCR engine. Creates a Form element containing the image, and additional text underneath. The Form element has a transformation matrix which makes it directly substitutable for the image in a Content stream.

This method may throw an exception if it can't find a font that will represent all the characters in a word. See the candidateFontNames on OCRParams to supply more fonts.

place_text_under

std::unique_ptr< Form >place_text_under(Image &image, Document &document, OCRMissingFontStrategystrategy)

Parameters

image: Image &

The image in which to recognize text.

document: Document &

Returns:

a Form element containing the image with text underneath.

Recognize text with a missing font strategy.

Run the image through an OCR engine. Creates a Form element containing the image, and additional text underneath. The Form element has a transformation matrix which makes it directly substitutable for the image in a Content stream.

This method may throw an exception if it can't find a font that will represent all the characters in a word. See the candidateFontNames on OCRParams to supply more fonts.