Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

New-OfficeOcrOptions

Module
PSWriteOffice
Inputs
None
Outputs
PSWriteOffice.Models.Reader.OfficeOcrOptions

Creates OCR settings without starting a provider or downloading language data.

Syntax

New-OfficeOcrOptions
[-DataDirectory <String>]
[-Dpi <Int32>]
[-ExecutionOptions <OfficeDocumentOcrExecutionOptions>]
[-Language <TesseractOcrLanguage[]>]
[-LanguageExpression <String>]
[-MinimumConfidence <Double>]
[-NoLanguageDownload]
[-RecognitionOptions <PdfOcrMergeOptions>]
[-SessionOptions <TesseractOcrSessionOptions>]
[-TesseractPath <String>]
[-TimeoutSeconds <Int32>]
[<CommonParameters>]
#
Parameter set: Tesseract
New-OfficeOcrOptions
[-ExecutionOptions <OfficeDocumentOcrExecutionOptions>]
[-MinimumConfidence <Double>]
-ProcessOptions <ProcessOcrEngineOptions>
[-RecognitionOptions <PdfOcrMergeOptions>]
[<CommonParameters>]
#
Parameter set: Process
New-OfficeOcrOptions
-Engine <IOcrEngine>
[-ExecutionOptions <OfficeDocumentOcrExecutionOptions>]
[-MinimumConfidence <Double>]
[-RecognitionOptions <PdfOcrMergeOptions>]
[<CommonParameters>]
#
Parameter set: Engine

Description

Flat Tesseract parameters override an independent snapshot of SessionOptions. ProcessOptions and Engine select an alternative provider.

Examples

Read a scanned image with selected languages.

$ocr = New-OfficeOcrOptions -Language English,Polish -Dpi 300 -NoLanguageDownload
Read-OfficeDocument ./scan.png -As Text -OcrOptions $ocr

Parameters

-DataDirectory String optionalsets: Tesseract
Local directory containing installed trained-data files.
-Dpi Int32 optionalsets: Tesseract
Image resolution supplied to Tesseract.
-ExecutionOptions OfficeDocumentOcrExecutionOptions optional
Bounded recognition and enrichment policy for document views.
-Language TesseractOcrLanguage[] optionalsets: Tesseract
Friendly languages for the local Tesseract provider.
Possible values: English, Polish, Arabic, ChineseSimplified, ChineseTraditional, Czech, Danish, Dutch, Finnish, French, German, Greek, Hebrew, Hindi, Hungarian, Italian, Japanese, Korean, Norwegian, Portuguese, Romanian, Russian, Slovak, Spanish, Swedish, Turkish, Ukrainian, Vietnamese
-LanguageExpression String optionalsets: Tesseract
Raw Tesseract language expression for caller-installed trained data.
-MinimumConfidence Double optional
Minimum word confidence accepted into an editable OCR review.
-NoLanguageDownload SwitchParameter optionalsets: Tesseract
Disable downloading missing curated language data.
-RecognitionOptions PdfOcrMergeOptions optional
Layout, confidence and resource policy for image or PDF reviews.
-SessionOptions TesseractOcrSessionOptions optionalsets: Tesseract
Advanced Tesseract settings; flat parameters override matching values.
-TesseractPath String optionalsets: Tesseract
Explicit local Tesseract executable path.
-TimeoutSeconds Int32 optionalsets: Tesseract
Maximum duration of a Tesseract process, in seconds.
-ProcessOptions ProcessOcrEngineOptions requiredsets: Process
Settings for the native generic JSON file-protocol OCR provider.
-Engine IOcrEngine requiredsets: Engine
Caller-provided OCR engine, used only when recognition is requested.

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.

Outputs

PSWriteOffice.Models.Reader.OfficeOcrOptions: Optional OCR provider and existing native policies used by document reads and OCR reviews.