# PdfOcrOptions class

> Settings for PdfOcr. PdfOcrOptions class, PdfNetStack.Ocr namespace.

Namespace: [PdfNetStack.Ocr](https://www.jadev-corp.com/api/pdfnetstack-ocr/)  
Assembly: PdfNetStack.Ocr.dll  
Package: `PdfNetStack.Ocr`

Settings for [PdfOcr](https://www.jadev-corp.com/api/pdfnetstack-ocr/pdfocr/).

```csharp
public sealed class PdfOcrOptions
```

**Inheritance**

[object](https://learn.microsoft.com/dotnet/api/system.object) ← 
[PdfOcrOptions](https://www.jadev-corp.com/api/pdfnetstack-ocr/pdfocroptions/)

## Properties

### <a id="PdfNetStack_Ocr_PdfOcrOptions_DetectOrientation"></a> DetectOrientation

Find scans whose text is turned a quarter or half turn with nothing in the PDF saying so,
as when a page is fed into a scanner sideways, and read them turned back. Only pages where
most of the text read does not run left to right cost more: a reduced copy is read in each
of the four orientations, then the page once more in the best one.

```csharp
public bool DetectOrientation { get; init; }
```

#### Property Value

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="PdfNetStack_Ocr_PdfOcrOptions_Languages"></a> Languages

Scripts to read: <code>latin</code>, <code>arabic</code>. With several, each line keeps the reading
its recognizer is most confident in. The engine must have each one loaded.

```csharp
public IReadOnlyList<string> Languages { get; init; }
```

#### Property Value

 [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist\-1)<[string](https://learn.microsoft.com/dotnet/api/system.string)\>

### <a id="PdfNetStack_Ocr_PdfOcrOptions_MaxDegreeOfParallelism"></a> MaxDegreeOfParallelism

Pages recognized at once. Each holds its decoded scan in memory.

```csharp
public int MaxDegreeOfParallelism { get; init; }
```

#### Property Value

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

### <a id="PdfNetStack_Ocr_PdfOcrOptions_MaxImagePixels"></a> MaxImagePixels

Scans with more pixels are skipped rather than decoded: about 11,500 by 11,500.

```csharp
public long MaxImagePixels { get; init; }
```

#### Property Value

 [long](https://learn.microsoft.com/dotnet/api/system.int64)

### <a id="PdfNetStack_Ocr_PdfOcrOptions_MaxOcrDpi"></a> MaxOcrDpi

Scans finer than this are averaged down to it before recognition.

```csharp
public double MaxOcrDpi { get; init; }
```

#### Property Value

 [double](https://learn.microsoft.com/dotnet/api/system.double)

### <a id="PdfNetStack_Ocr_PdfOcrOptions_MinimumConfidence"></a> MinimumConfidence

Lines read with less confidence than this are left out.

```csharp
public double MinimumConfidence { get; init; }
```

#### Property Value

 [double](https://learn.microsoft.com/dotnet/api/system.double)

### <a id="PdfNetStack_Ocr_PdfOcrOptions_MinimumCoverage"></a> MinimumCoverage

Share of the crop box an image must cover to be read as the page's scan.

```csharp
public double MinimumCoverage { get; init; }
```

#### Property Value

 [double](https://learn.microsoft.com/dotnet/api/system.double)

### <a id="PdfNetStack_Ocr_PdfOcrOptions_Rasterizer"></a> Rasterizer

Renders pages that have no scan to read: text drawn as vector outlines, vector art with
images too small to be a scan, or scans in encodings or placements that are not decoded.
Null (the default) leaves such pages unread. PdfNetStack has no renderer; see
[IPdfPageRasterizer](https://www.jadev-corp.com/api/pdfnetstack-ocr/ipdfpagerasterizer/).

```csharp
public IPdfPageRasterizer? Rasterizer { get; init; }
```

#### Property Value

 [IPdfPageRasterizer](https://www.jadev-corp.com/api/pdfnetstack-ocr/ipdfpagerasterizer/)?

### <a id="PdfNetStack_Ocr_PdfOcrOptions_RasterizerDpi"></a> RasterizerDpi

The resolution pages are rendered at by [Rasterizer](https://www.jadev-corp.com/api/pdfnetstack-ocr/pdfocroptions/#PdfNetStack_Ocr_PdfOcrOptions_Rasterizer), at most [MaxOcrDpi](https://www.jadev-corp.com/api/pdfnetstack-ocr/pdfocroptions/#PdfNetStack_Ocr_PdfOcrOptions_MaxOcrDpi).

```csharp
public double RasterizerDpi { get; init; }
```

#### Property Value

 [double](https://learn.microsoft.com/dotnet/api/system.double)

### <a id="PdfNetStack_Ocr_PdfOcrOptions_SkipPagesWithText"></a> SkipPagesWithText

Leave pages that already show text alone, so OCR never runs twice over a page.

```csharp
public bool SkipPagesWithText { get; init; }
```

#### Property Value

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

## Used in

- [Make scanned PDFs searchable with OCR in C#](https://www.jadev-corp.com/guides/ocr/)
- [Make a scanned PDF searchable in C#](https://www.jadev-corp.com/recipes/make-scanned-pdf-searchable/)

Source: https://www.jadev-corp.com/pdfnetstack/api/pdfnetstack-ocr/pdfocroptions/
