Skip to content

PdfOcrOptions class

View as Markdown

Namespace: PdfNetStack.Ocr
Assembly: PdfNetStack.Ocr.dll
Package: PdfNetStack.Ocr

Settings for PdfOcr.

public sealed class PdfOcrOptions

Inheritance

object ← PdfOcrOptions

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.

public bool DetectOrientation { get; init; }

bool

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

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

IReadOnlyList<string>

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

public int MaxDegreeOfParallelism { get; init; }

int

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

public long MaxImagePixels { get; init; }

long

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

public double MaxOcrDpi { get; init; }

double

Lines read with less confidence than this are left out.

public double MinimumConfidence { get; init; }

double

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

public double MinimumCoverage { get; init; }

double

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.

public IPdfPageRasterizer? Rasterizer { get; init; }

IPdfPageRasterizer?

The resolution pages are rendered at by Rasterizer, at most MaxOcrDpi.

public double RasterizerDpi { get; init; }

double

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

public bool SkipPagesWithText { get; init; }

bool