# OCRParams Class

> Class OCRParams.

- Product: Adobe PDF Library 18
- Language: Java
- Version: APDFL18.0.5PlusP2a
- HTML page: https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/OCRParams
- Version index: https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/llms.txt

```java
class OCRParams
```

**Namespace:** `com::datalogics::PDFL`

**Referenced by:** [`OCREngine`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/OCREngine.md)

**Uses types:** [`LanguageSetting`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/LanguageSetting.md)

## Constructors

### OCRParams

```java
com.datalogics.PDFL.OCRParams.OCRParams()
```

*constructor*

Create an OCRParams structure with defaults.

## Methods

### delete

```java
synchronized void com.datalogics.PDFL.OCRParams.delete(Boolean disposing)
```

*protected*

**Parameters**

- `disposing` (`Boolean`)

**Returns:** `synchronized void`

### delete

```java
synchronized void com.datalogics.PDFL.OCRParams.delete()
```

**Returns:** `synchronized void`

### finalize

```java
void com.datalogics.PDFL.OCRParams.finalize()
```

*protected*

**Returns:** `void`

### getCandidateFontNames

```java
java.util.List< String > com.datalogics.PDFL.OCRParams.getCandidateFontNames()
```

**Returns:** `java.util.List< String >`

The names of candidate fonts for placing text under an image. The default list should work well in most cases. If you're using text that isn't represented by Latin fonts, or by Chinese, Japanese, or Korean fonts, then retrieve this list, add the font that can represent that text, then set that new list on this object.

Enough font names must be supplied to cover the expected languages/scripts in use.

The code selects a font to represent each word. If a word code-switches between different scripts, for instance, if it contains non-Latin text and Arabic numerals, then make sure to supply the name of a font family that can handle both the text and the numerals.

The quality of the results depends on the font choice. The list is searched in order until a font works for a particular word. To make the text fit better, it's recommended to list proportional fonts before fixed-width fonts. Decorative fonts with flourishes, like Zapf Chancery, deliver poor results. Generally, supply a font that would be used in block text, such as in a newspaper or work of literature, such as Times Roman, or a font already in the list, like MinionPro.

If the PlaceTextUnder method in OCREngine can't identify a font that covers the whole text of a word, an exception will be thrown.

### getConfigurationParameters

```java
java.util.Map< String, String > com.datalogics.PDFL.OCRParams.getConfigurationParameters()
```

**Returns:** `java.util.Map< String, String >`

Get the configuration parameters. Note: Reserved for internal use. Do not use unless directed to by Datalogics Support.

### getEnableImagePreprocessing

```java
boolean com.datalogics.PDFL.OCRParams.getEnableImagePreprocessing()
```

**Returns:** `boolean`

Get the image preprocessing enable state.True if any image preprocessing is on.

### getEngine

```java
String com.datalogics.PDFL.OCRParams.getEngine()
```

**Returns:** `String`

The engine in use.

### getLanguages

```java
java.util.List< LanguageSetting > com.datalogics.PDFL.OCRParams.getLanguages()
```

**Returns:** [`java.util.List< LanguageSetting >`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/LanguageSetting.md)

The list of languages to use.

### getPageSegmentationMode

```java
PageSegmentationMode com.datalogics.PDFL.OCRParams.getPageSegmentationMode()
```

**Returns:** `PageSegmentationMode`

The page segmentation mode.

### getPerformance

```java
Performance com.datalogics.PDFL.OCRParams.getPerformance()
```

**Returns:** `Performance`

The desired engine performance.

### getResolution

```java
double com.datalogics.PDFL.OCRParams.getResolution()
```

**Returns:** `double`

Each image will use this resolution by default.

### getTesseract4Engine

```java
static String com.datalogics.PDFL.OCRParams.getTesseract4Engine()
```

*static*

**Returns:** `String`

Specify the Tesseract v4 engine.Pass this to the engine property.

### setCandidateFontNames

```java
void com.datalogics.PDFL.OCRParams.setCandidateFontNames(java.util.List< String > candidateFontNames)
```

**Parameters**

- `candidateFontNames` (`java.util.List< String >`)

**Returns:** `void`

The names of candidate fonts for placing text under an image. The default list should work well in most cases. If you're using text that isn't represented by Latin fonts, or by Chinese, Japanese, or Korean fonts, then retrieve this list, add the font that can represent that text, then set that new list on this object.

Enough font names must be supplied to cover the expected languages/scripts in use.

The code selects a font to represent each word. If a word code-switches between different scripts, for instance, if it contains non-Latin text and Arabic numerals, then make sure to supply the name of a font family that can handle both the text and the numerals.

The quality of the results depends on the font choice. The list is searched in order until a font works for a particular word. To make the text fit better, it's recommended to list proportional fonts before fixed-width fonts. Decorative fonts with flourishes, like Zapf Chancery, deliver poor results. Generally, supply a font that would be used in block text, such as in a newspaper or work of literature, such as Times Roman, or a font already in the list, like MinionPro.

If the PlaceTextUnder method in OCREngine can't identify a font that covers the whole text of a word, an exception will be thrown.

### setConfigurationParameters

```java
void com.datalogics.PDFL.OCRParams.setConfigurationParameters(java.util.Map< String, String > configurationParameters)
```

**Parameters**

- `configurationParameters` (`java.util.Map< String, String >`)

**Returns:** `void`

Set the configuration parameters. Note: Reserved for internal use. Do not use unless directed to by Datalogics Support.

### setEnableImagePreprocessing

```java
void com.datalogics.PDFL.OCRParams.setEnableImagePreprocessing(boolean enable)
```

**Parameters**

- `enable` (`boolean`)

**Returns:** `void`

Enable all image preprocessing, default enabled.Note that once the OCREngine is initialized, this setting is permanent.

### setEngine

```java
void com.datalogics.PDFL.OCRParams.setEngine(String engine)
```

**Parameters**

- `engine` (`String`)

**Returns:** `void`

The engine in use.

### setLanguages

```java
void com.datalogics.PDFL.OCRParams.setLanguages(java.util.List< LanguageSetting > languages)
```

**Parameters**

- `languages` ([`java.util.List< LanguageSetting >`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/LanguageSetting.md))

**Returns:** `void`

The list of languages to use.

### setPageSegmentationMode

```java
void com.datalogics.PDFL.OCRParams.setPageSegmentationMode(PageSegmentationMode mode)
```

**Parameters**

- `mode` (`PageSegmentationMode`)

**Returns:** `void`

The page segmentation mode.

### setPerformance

```java
void com.datalogics.PDFL.OCRParams.setPerformance(Performance performance)
```

**Parameters**

- `performance` (`Performance`)

**Returns:** `void`

The desired engine performance.

### setResolution

```java
void com.datalogics.PDFL.OCRParams.setResolution(double resolution)
```

**Parameters**

- `resolution` (`double`)

**Returns:** `void`

Each image will use this resolution by default.
