OCREngine Class Documentation

classOCREngine

Namespace:com::datalogics::PDFL

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.

Referenced by

Constructor & Destructor Documentation

OCREngine

OCREngine()

Create an OCR engine.

OCREngine

OCREngine(OCRParamsocrParams)

Parameters

ocrParams: OCRParams

the configuration to use

Create an OCR engine with a specified configuration.

Member Function Documentation

DisposeChildren

voidDisposeChildren()

Returns:

void

[static initializer]

static void[static initializer]()

delete

synchronized voiddelete(Booleandisposing)

Parameters

disposing: Boolean

Returns:

synchronized void

delete

synchronized voiddelete()

Returns:

synchronized void

finalize

voidfinalize()

Returns:

void

getAvailableLanguages

java.util.List< Language >getAvailableLanguages()

Returns:

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

Get a list of languages this OCREngine can use.

isLanguageAvailable

booleanisLanguageAvailable(Languagelanguage)

Parameters

language: Language

the language to check

Returns:

true if the language is available, false otherwise

Query if a language for OCR is available for use.

placeTextUnder

FormplaceTextUnder(Imageimage)

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 element with the image and the 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.

placeTextUnder

FormplaceTextUnder(Imageimage, DocumentinDocument)

Parameters

image: Image

The image in which to recognize text.

inDocument: Document

The destination document for the created form.

Returns:

a Form element containing the image with text underneath.

Recognize text in the image, returning a form element with the image and the 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.

The form will be created in the specified document, sharing fonts with the results of recognizing text in other images.

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.

placeTextUnder

FormplaceTextUnder(Imageimage, DocumentinDocument, doubleresolution)

Parameters

image: Image

The image in which to recognize text.

inDocument: Document

The destination document for the created form.

resolution: double

The resolution of the Image being recognized.

Returns:

a Form element containing the image with text underneath.

Recognize text in the image of the known resolution, returning a form element with the image and the text underneath.Knowing the image's resolution can enhance recognition. NOTE: Determining the resolution of the image is the caller's responsibility.

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.

The form will be created in the specified document, sharing fonts with the results of recognizing text in other images.

If a font that will represent all the characters in a word can't be found, an exception will be raised.

placeTextUnder

FormplaceTextUnder(Imageimage, DocumentinDocument, doubleresolution, MissingFontStrategymissingFontStrategy)

Parameters

image: Image

The image in which to recognize text.

inDocument: Document

The destination document for the created form.

resolution: double

The resolution of the Image being recognized.

missingFontStrategy: MissingFontStrategy

The behavior to use if a Font can't be found to represent the recognized text.

Returns:

a Form element containing the image with text underneath.

Recognize text in the image of the known resolution, returning a form element with the image and the text underneath.Knowing the image's resolution can enhance recognition. NOTE: Determining the resolution of the image is the caller's responsibility.

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.

The form will be created in the specified document, sharing fonts with the results of recognizing text in other images.

If a font that will represent all the characters in a word can't be found, the missingFontStrategy will determine the behavior to employ.

placeTextUnder

FormplaceTextUnder(Imageimage, DocumentinDocument, MissingFontStrategymissingFontStrategy)

Parameters

image: Image

The image in which to recognize text.

inDocument: Document

The destination document for the created form.

missingFontStrategy: MissingFontStrategy

The behavior to use if a Font can't be found to represent the recognized text.

Returns:

a Form element containing the image with text underneath.

Recognize text in the image, returning a form element with the image and the text underneath.Knowing the image's resolution can enhance recognition. 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.

The form will be created in the specified document, sharing fonts with the results of recognizing text in other images.

If a font that will represent all the characters in a word can't be found, the missingFontStrategy will determine the behavior to employ.