Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

New-OfficeDocumentReader

Module
PSWriteOffice
Inputs
None
Outputs
OfficeIMO.Reader.OfficeDocumentReader

Creates an immutable document reader with common policies, format options and optional OCR.

Syntax

New-OfficeDocumentReader
[-MaximumConcurrentReads <Int32>]
[-MaximumStoreItems <Int32>]
[-Ocr]
[-OcrOptions <OfficeOcrOptions>]
[-Options <Object[]>]
[-Processor <IOfficeDocumentProcessor[]>]
[-ProcessorFailureBehavior <Throw|ContinueWithDiagnostic|StopWithDiagnostic>]
[<CommonParameters>]
#
Parameter set: Default

Examples

Reuse one configured reader across a report folder.

$options = New-OfficeDocumentReaderOptions -Projection TextAndMetadata
$reader = New-OfficeDocumentReader -Options $options -MaximumConcurrentReads 4
Read-OfficeDocument ./Reports -Recurse -Reader $reader -As Text

Configure optional OCR with one settings object.

$ocr = New-OfficeOcrOptions -Language English,Polish -NoLanguageDownload
$reader = New-OfficeDocumentReader -OcrOptions $ocr
Read-OfficeDocument ./Scans -Reader $reader

Parameters

-MaximumConcurrentReads Int32 optional
Maximum concurrent native document reads.
-MaximumStoreItems Int32 optional
Maximum items projected from each mail store; zero means all.
-Ocr SwitchParameter optional
Enable the default local OCR provider.
-OcrOptions OfficeOcrOptions optional
Optional OCR provider and execution settings. Implies Ocr.
-Options Object[] optional
Typed common and format options, or common/format-keyed hashtables.
-Processor IOfficeDocumentProcessor[] optional
Ordered processors applied after native extraction.
-ProcessorFailureBehavior OfficeDocumentProcessorFailureBehavior optional
How ordinary processor failures affect the operation. Safety limits remain terminal.
Possible values: Throw, ContinueWithDiagnostic, StopWithDiagnostic

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.