# New-OfficeDocumentReader

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

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`None`

**Outputs**

`OfficeIMO.Reader.OfficeDocumentReader`

**Source**

[NewOfficeDocumentReaderCommand.cs:20](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/PowerShell/PSWriteOffice/Sources/PSWriteOffice/Cmdlets/Reader/NewOfficeDocumentReaderCommand.cs#L20) 

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>]
```

[#](#method-new-officedocumentreader-int32-int32-switchparameter-officeocroptions-object-iofficedocumentprocessor-officedocumentprocessorfailurebehavior)

Parameter set: `Default`

## Guides & Samples

Authored walkthroughs and practical samples linked to this command.

- [Choose a PSWriteOffice Workflow](/docs/pswriteoffice/choosing-a-workflow/) Guide
  
  Decide between authoring, editing, inspection, conversion, and normalized Reader extraction. Includes examples and cmdlet links.

## Examples

### Reuse one configured reader across a report folder.

```powershell
$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.

```powershell
$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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

<!-- PowerForge markdown artifact sha256:4D35EFFD72F781F778CBAC437EF15FD846141A22B19D3869E45111EF6E287DCB -->
