# PdfOcrExtensions

Optional OCR operations for loaded PDF documents.

Class 

`OfficeIMO.Pdf.Ocr`

**Namespace**

`OfficeIMO.Pdf.Ocr`

**Assembly**

`OfficeIMO.Pdf.Ocr`

**Source revision**

`063fe3ee9839` with working tree changes

**Source**

[PdfOcrExtensions.cs:12](https://github.com/EvotecIT/OfficeIMO/blob/063fe3ee9839db87940fc9ed8ae72f1f44b10982/OfficeIMO.Pdf.Ocr/PdfOcrExtensions.cs#L12)

**Modifiers**

static

Optional OCR operations for loaded PDF documents.

## Inheritance

- object
- PdfOcrExtensions

Filter members 

Show inherited

## Methods

`public static async Task<PdfSearchableOcrResult> MakeSearchableAsync(PdfDocument document, IOcrEngine engine, PdfOcrMergeOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-makesearchableasync-officeimo-pdf-pdfdocument-officeimo-ocr-iocrengine-officeimo-pdf-ocr-pdfocrmergeoptions-threading-cancellationtoken)

Returns a PDF with geometry-aligned invisible text for accepted OCR spans. Pages without accepted OCR content remain unchanged. Existing digital signatures may block the required full rewrite.

Parameters

**document OfficeIMO.Pdf.PdfDocument required**

**engine OfficeIMO.Ocr.IOcrEngine required**

**options OfficeIMO.Pdf.Ocr.PdfOcrMergeOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`Task<PdfSearchableOcrResult>`

`public static Task<PdfPageOrientationReview> PrepareOrientationReviewAsync(PdfDocument document, IOcrEngine engine, PdfOcrMergeOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-prepareorientationreviewasync-officeimo-pdf-pdfdocument-officeimo-ocr-iocrengine-officeimo-pdf-ocr-pdfocrmergeoptions-threading-cancellationtoken)

[PdfOcr.OrientationReview.cs:11](https://github.com/EvotecIT/OfficeIMO/blob/063fe3ee9839db87940fc9ed8ae72f1f44b10982/OfficeIMO.Pdf.Ocr/PdfOcr.OrientationReview.cs#L11)

Detects whole-page corrective quarter-turns on a private snapshot without changing the PDF.

Parameters

**document OfficeIMO.Pdf.PdfDocument required**

**engine OfficeIMO.Ocr.IOcrEngine required**

**options OfficeIMO.Pdf.Ocr.PdfOcrMergeOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`Task<PdfPageOrientationReview>`

`public static async Task<PdfSearchableOcrReview> PrepareSearchableOcrAsync(PdfDocument document, IOcrEngine engine, PdfOcrMergeOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-preparesearchableocrasync-officeimo-pdf-pdfdocument-officeimo-ocr-iocrengine-officeimo-pdf-ocr-pdfocrmergeoptions-threading-cancellationtoken)

Recognizes a private source snapshot and returns review evidence without modifying or publishing a PDF.

Parameters

**document OfficeIMO.Pdf.PdfDocument required**

**engine OfficeIMO.Ocr.IOcrEngine required**

**options OfficeIMO.Pdf.Ocr.PdfOcrMergeOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`Task<PdfSearchableOcrReview>`

`public static Task<PdfScanPreview> PreviewScanAsync(PdfDocument document, int pageNumber, PdfOcrMergeOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-previewscanasync-officeimo-pdf-pdfdocument-int32-officeimo-pdf-ocr-pdfocrmergeoptions-threading-cancellationtoken)

[PdfOcrExtensions.cs:12](https://github.com/EvotecIT/OfficeIMO/blob/063fe3ee9839db87940fc9ed8ae72f1f44b10982/OfficeIMO.Pdf.Ocr/PdfOcrExtensions.cs#L12)

Previews one page using the same region, perspective, and scan preparation as OCR, without invoking a provider. Provider orientation detection is not performed. Source bytes remain unchanged.

Parameters

**document OfficeIMO.Pdf.PdfDocument required**

**pageNumber int required**

**options OfficeIMO.Pdf.Ocr.PdfOcrMergeOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`Task<PdfScanPreview>`

`public static Task<PdfOcrMergeResult> ReadWithOcrAsync(PdfDocument document, IOcrEngine engine, PdfOcrMergeOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-readwithocrasync-officeimo-pdf-pdfdocument-officeimo-ocr-iocrengine-officeimo-pdf-ocr-pdfocrmergeoptions-threading-cancellationtoken)

[PdfOcrExtensions.cs:26](https://github.com/EvotecIT/OfficeIMO/blob/063fe3ee9839db87940fc9ed8ae72f1f44b10982/OfficeIMO.Pdf.Ocr/PdfOcrExtensions.cs#L26)

Renders selected pages, invokes an engine-neutral OCR provider, and merges accepted spans into the same logical result contract returned by PdfDocument.Read.

Parameters

**document OfficeIMO.Pdf.PdfDocument required**

**engine OfficeIMO.Ocr.IOcrEngine required**

**options OfficeIMO.Pdf.Ocr.PdfOcrMergeOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`Task<PdfOcrMergeResult>`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

<!-- PowerForge markdown artifact sha256:908489410DFF0A4E9B11AEC2583143EC339C24C41014052565F0E983089D00F3 -->
